[PHP] Re: links extract from a string
use http://php.net/preg_match "Syed Ghouse" <[EMAIL PROTECTED]> $B'c'`'`'R'k'Z'](B/$B'c'`'`'R'k'Z']'Q(B $B'S(B $B'_'`'S'`'c'd'q'g(B $B'c']'V'U'e'p'k'V'V(B: news:[EMAIL PROTECTED] Hi all i m doing a project in which i m displaying the statistics of clickcounts of links send thru a message. For that i have to extract the links from the message string given by user. So pls tell me how to get the url/links from a string (or) To track clicks of all outgoing links embedded in the message string Thanks Syed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] links extract from a string
Hi all (B (Bi m doing a project in which i m displaying the statistics of (B (Bclickcounts of links send thru a message. (B (BFor that i have to extract the links from the message string given by user. (B (BSo pls tell me how to get the url/links from a string (or) To track clicks of all (Boutgoing links embedded in the message string (B (BThanks (B (BSyed
Re: [PHP] Crazy Serialize/Header/$_POST PHP Error - Is this a bug?
curt, it`s a bug. on my machine [Apache/2.0.48 (Win32) PHP/4.3.8] all works fine - as expected "Curt Zirzow" <[EMAIL PROTECTED]> ???/ ? ?: news:[EMAIL PROTECTED] > * Thus wrote Peters, Eric: > > I think I've boiled my problemfor some reason I can't header() a serialized $_POST variable > > > > Running PHP 5.0 Final (and also tested with 4.3.3): > > > > -- begin file -- > > > > > > > function jpcache_debug2($s) > > { > > header("X-CacheDebug-five: $s"); > > Might need to have a quoted string: > > $s = str_replace('"','\\"', $s); // change " -> \" > header("X-CacheDebug-five: \"$s\""); > > even with that logic, your output does seem strange indeed. > > > > Curt > -- > First, let me assure you that this is not one of those shady pyramid schemes > you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick globalisation?
Jay, "global $a, $b, $c" is used for bringing global variables INTO the scope of the function... what I'm after is a way of making localised variables (in function) available outside of the function. Justin On 24/08/2004, at 1:38 AM, Jay Blanchard wrote: [snip] Is there a quicker way to globalise something other than: $a = 'foo'; $b = 'bah'; ... $GLOBALS['a'] = $a; $GLOBALS['b'] = $b; ?? I was hoping for something like $a = 'foo'; $b = 'bah'; ... makeGlobal('a','b') /*or*/ makeGlobal($a,$b); [/snip] According to http://us3.php.net/language.variables.scope you could do something like global $a, $b, $c, ...; --- Justin French http://indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crazy Serialize/Header/$_POST PHP Error - Is this a bug?
* Thus wrote Peters, Eric: > I think I've boiled my problemfor some reason I can't header() a serialized > $_POST variable > > Running PHP 5.0 Final (and also tested with 4.3.3): > > -- begin file -- > > > function jpcache_debug2($s) > { > header("X-CacheDebug-five: $s"); Might need to have a quoted string: $s = str_replace('"','\\"', $s); // change " -> \" header("X-CacheDebug-five: \"$s\""); even with that logic, your output does seem strange indeed. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to add Zlib support
* Thus wrote Mauricio Pellegrini: > > It's a requisite that the compression library has to be zlib. > > I don't know how to do that. > > I guess I should reconfigure with > > './configure' > '--with-mysql' > '--with-apxs=/usr/local/apache/bin/apxs' > '--with-zlib' > '-enable-dbase' > > then run ./make and ./make install > > But I'm afraid tha something could go wrong and end-up > with a whole useless installation These procdures should go without any flaws. If you're extra parnoid, the best thing to do is back up your current stuff so incase there is something wrong, you can restore them: php module for apache should be located in: /usr/local/apache/libexec/libphp.so php config files: /usr/local/lib/php*.ini php misc files (aka pear, headers, etc.): /usr/local/lib/php/* And finaly the executables for php: /usr/local/bin/php* HTH, Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to count objects instances
On Mon, 2004-08-23 at 20:33, Curt Zirzow wrote: > * Thus wrote Robert Cummings: > > On Mon, 2004-08-23 at 20:54, John Holmes wrote: > > > [EMAIL PROTECTED] wrote: > > > > > > You could write a wrapper class for Test that kept count of the > > > instances and returned a new object upon request... > > > > In PHP5: > > > > > > > class Foo > > { > > static $instances = 0; > > > > function __construct() > > { > > Foo::$instances++; > > } > > > > function __destruct() > > { > > Foo::$instances--; > > } > > And: > function __clone() > { > Foo::$instances++; > } Perfect. I hadn't thought of that :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Crazy Serialize/Header/$_POST PHP Error - Is this a bug?
I think I've boiled my problemfor some reason I can't header() a serialized $_POST variable Running PHP 5.0 Final (and also tested with 4.3.3): -- begin file -- -- end file -- Response Headers - Begin output: Date: Mon, 23 Aug 2004 23:56:14 GMT Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/5.0.0 mod_ssl/2.8.12 OpenSSL/0.9.6b X-Powered-By: PHP/5.0.0 X-CacheDebug-five: a:0:{} Connection: close Transfer-Encoding: chunked Content-Type: text/html a:1:{s:3:"foo";s:3:"bar";} Anyone know why my header() output behaves so funky? Thanks, Eric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using php_value in .htaccess files
* Thus wrote [EMAIL PROTECTED]: > > I believe Apache's Allowoverride directive must have "Options" or > > "+Options" set for php_value changes to be permitted on a per-directory > > basis in .htaccess files. > > > > "Allowoverride All" is one way to make sure they're permitted. :D > > So... if I throw an override all in the .htaccess file I'm set? ;) > > ... > So using .htaccess files themselves is apparently OK on this one. > It's when I throw in the php_value statement that things blow up > any ideas why? Seek the apache error_log, it will tell you exactly why the 500 occurse. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to count objects instances
* Thus wrote Robert Cummings: > On Mon, 2004-08-23 at 20:54, John Holmes wrote: > > [EMAIL PROTECTED] wrote: > > > > You could write a wrapper class for Test that kept count of the > > instances and returned a new object upon request... > > In PHP5: > > > class Foo > { > static $instances = 0; > > function __construct() > { > Foo::$instances++; > } > > function __destruct() > { > Foo::$instances--; > } And: function __clone() { Foo::$instances++; } Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Building a "self-made" compilation of php?
Hi, I know that there are severals ways to add personnal functions into php and i am looking for documentation about how to realize it. If u need a bash explication, i want to do this with php: "./configure -with-my-stuff" Additional question: is it possible to link php scripting c++ rather than c ? thank you if u are going to give me any ((relative link) or (sample codes in c or c++) or (informations)) about that ! :o) mathieu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using php_value in .htaccess files
> I believe Apache's Allowoverride directive must have "Options" or > "+Options" set for php_value changes to be permitted on a per-directory > basis in .htaccess files. > > "Allowoverride All" is one way to make sure they're permitted. :D So... if I throw an override all in the .htaccess file I'm set? ;) But seriously... on the particular server I'm wondering about right now, I can use the directive: AddHandler server-parsed .html .htm So using .htaccess files themselves is apparently OK on this one. It's when I throw in the php_value statement that things blow up any ideas why? -Weston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using php_value in .htaccess files
> Is there anything special one has to do in order to enable the use of > the "php_value" directive in the context of an apache .htaccess file? > > I notice that on some hosts I can drop in something like: > > php_value auto_prepend_file groove.php > > with impunity. Other hosts, it causes Apache to generate an internal > server error. I believe Apache's Allowoverride directive must have "Options" or "+Options" set for php_value changes to be permitted on a per-directory basis in .htaccess files. "Allowoverride All" is one way to make sure they're permitted. :D - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to count objects instances
On Mon, 2004-08-23 at 20:54, John Holmes wrote: > [EMAIL PROTECTED] wrote: > > hi, > > What is best method(if it's possible) to count how many times an object is > > instanced in one time script call? > > I means that if i have a class named "Test", i what to know how many times she's > > called, how many copies exists etc. The idea is for monitoring in the way to > > optimizing the code. > > > > The method get_declared_classes() only shows only the classes included/required. > > There's no predefined variable or method for determining this, that I'm > aware of, short of counting how many "new Test" lines you have. > > You could write a wrapper class for Test that kept count of the > instances and returned a new object upon request... In PHP5: http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using php_value in .htaccess files
Is there anything special one has to do in order to enable the use of the "php_value" directive in the context of an apache .htaccess file? I notice that on some hosts I can drop in something like: php_value auto_prepend_file groove.php with impunity. Other hosts, it causes Apache to generate an internal server error. -Weston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Runtime Debugger (Was: [PHP] how to count objects instances)
> There's no predefined variable or method for determining this, that I'm > aware of, short of counting how many "new Test" lines you have. > > You could write a wrapper class for Test that kept count of the > instances and returned a new object upon request... A slightly more general question: are there any PHP development environments that let you do something like a core dump, to see what kind of memory usage or variable allocation you have going on? Maybe a compilation option to PHP? A search of google turns up DBG and some commercial packages, but I lack the experience with such tools to evaluate them intelligently. I've done something like what the OP is asking about, by adding a log() feature and calling it when objects are instantiated or destroyed, but it sure would be nice to see something like this built-in. I'm a gdb beginner, but I'm willing to learn. I realize that this is a fairly complex problem compounded by the fact that PHP is generally a library used within an apache child process. Any thoughts? - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [OFF] - Fraudulent web orders - any ideas?
On Mon, 23 Aug 2004 14:33:56 -0700, Brian Dunning <[EMAIL PROTECTED]> wrote: > The plot thickens. I added AVS *and* CVM to the site - and the Amex > orders are still going through. Amex ignores CVM, and the address was > correct, so the thieves must have gotten ahold of printed statements > that show the billing address. Any idea how to combat THAT? They are > using fake IP addresses now so I can't keep up by blocking IP's. > > Your clever ideas appreciated. > "Fake"? There's always a real IP on the other end or you can't communicate with them. There *has* to be a way to get the real IP address. How are you doing it now? What makes you think it's fake? One thing nobody mentioned was a CAPTCHA. There's a new, simple, one in PEAR: http://pear.php.net/package/Text_CAPTCHA http://www.captcha.net/ I know they're annoying, but it could cut things down if they're automating this. You could also resort to the "create a login" method. Or even a "valid e-mail address" option if you really want to stop them. We implemented a nice one-step credit card, address, and login method on www.pnicorp.com. Go to the link below and click "Continue Checkout". http://www.pnicorp.com/pniCart/?addItem=60 -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to count objects instances
[EMAIL PROTECTED] wrote: hi, What is best method(if it's possible) to count how many times an object is instanced in one time script call? I means that if i have a class named "Test", i what to know how many times she's called, how many copies exists etc. The idea is for monitoring in the way to optimizing the code. The method get_declared_classes() only shows only the classes included/required. There's no predefined variable or method for determining this, that I'm aware of, short of counting how many "new Test" lines you have. You could write a wrapper class for Test that kept count of the instances and returned a new object upon request... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to count objects instances
hi, What is best method(if it's possible) to count how many times an object is instanced in one time script call? I means that if i have a class named "Test", i what to know how many times she's called, how many copies exists etc. The idea is for monitoring in the way to optimizing the code. The method get_declared_classes() only shows only the classes included/required. Tanks -- This mail sent through Horde-Toaster (http://qmailtoaster.clikka.com/) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [OFF] - Fraudulent web orders - any ideas?
The plot thickens. I added AVS *and* CVM to the site - and the Amex orders are still going through. Amex ignores CVM, and the address was correct, so the thieves must have gotten ahold of printed statements that show the billing address. Any idea how to combat THAT? They are using fake IP addresses now so I can't keep up by blocking IP's. Your clever ideas appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:[PHP] system command
John Holmes wrote: From: "ron clark" <[EMAIL PROTECTED]> I an trying to add virus scanning to the file upload section of our portal using uvscan. The virus scanning is working properly using a system call , but I am having problems with formatting the output. I need to check the return value and if it is not a 0, I want to create a custom message. The problem is, when using system the output of the call is flushed to the browser before I can write the custom message so I have the uvscan message and then my custom message. You can use output_buffering to capture the output, or use a different method to make the call, i.e. backticks or exec(), which allow you to capture the output before it's displayed. ---John Holmes... Thanks John. Was a simple fix. Turn output buffering on to prevent the output of the system command going to the browser. Capture the output in the $output variable then ob_clean to empty the output buffer before printing the the desired message. -- Ron Clark System Administrator/Web Coordinator Armstrong Atlantic State University 11935 Abercorn Street Savannah, Ga 31419 Phone: 912 961 3234 Fax: 912 927 5353 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to add Zlib support
Hi , On March 9th this year I 've compiled and installed php 4.3.4 on SuSe linux Server with apache 1.3. The configure command was this: './configure' '--with-mysql' '--with-apxs=/usr/local/apache/bin/apxs' '-enable-dbase' Nowadays I'm urged to install zlib support in order to let the developers to make use of compressed files. It's a requisite that the compression library has to be zlib. I don't know how to do that. I guess I should reconfigure with './configure' '--with-mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-zlib' '-enable-dbase' then run ./make and ./make install But I'm afraid tha something could go wrong and end-up with a whole useless installation Could someone point me in the right direction? Thanks Mauricio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to add zlib support
I dont see how this has anything to do with: - Cookie behaviour - opening a save dialog box. - unlink and rmdir problems Please start a new email when starting a new topic, this is the 3rd unrelated topic that has been started on this thread. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] readfile()
Not too familure with a chroot'd web setup and I dont know if my ISP has some security that I dont know about. I tried some tests with file_exists() and it doesnt seemt to be able to get to the files either. I've put in an info request to my ISP but they are usually not much help with something this advanced. Is there anything else I can do to further diagnose this problem? Thanks again, Aaron "Greg Donald" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Mon, 2004-08-23 at 13:02, Aaron Todd wrote: >> I'm trying to use readfile() to allow a user to download a file that is >> outside of my webroot. >> >> webroot = /var/www/html >> downloads dir = /var/www/downloads >> >> Here is the code that I have been using: >> $file = "/var/www/downloads/test.txt"; >> header("Content-Description: File Transfer"); >> header("Content-Type: application/force-download"); >> header("Content-Disposition: attachment; filename=".basename($file)); >> readfile($file); >> >> This code will work if I change the path to the webroot path, but not the >> downloads dir path. I get an error saying "Unable to access" and then >> "failed to open stream: No such file or directory". >> >> I have given whe I believe is the correct rights for the downloads dir >> and >> also the file...rwxr-xr-x for both. >> >> Anyone have any idea why this isnt working? > > Is the download directory outside a chroot'd web setup perhaps? Or > maybe your provider has some security you don't know about? > > There are some file related functions you can debug with, like > is_readable(), and file_exists(). > > > -- > Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] system command
On Tuesday 24 August 2004 03:49, ron clark wrote: > I an trying to add virus scanning to the file upload section of our > portal using uvscan. The virus scanning is working properly using a > system call , but I am having problems with formatting the output. I > need to check the return value and if it is not a 0, I want to create a > custom message. The problem is, when using system the output of the call > is flushed to the browser before I can write the custom message so I > have the uvscan message and then my custom message. The system() function has a few siblings, check them out. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Democracy is a process by which the people are free to choose the man who will get the blame. -- Laurence J. Peter */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] system command
From: "ron clark" <[EMAIL PROTECTED]> I an trying to add virus scanning to the file upload section of our portal using uvscan. The virus scanning is working properly using a system call , but I am having problems with formatting the output. I need to check the return value and if it is not a 0, I want to create a custom message. The problem is, when using system the output of the call is flushed to the browser before I can write the custom message so I have the uvscan message and then my custom message. You can use output_buffering to capture the output, or use a different method to make the call, i.e. backticks or exec(), which allow you to capture the output before it's displayed. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
Ave, Richard... What exactly did you mean by this? system('rm -rf',$user_dir,$ret_val); I don't understand. On 8/23/04 12:11 PM, "Richard Whitney" <[EMAIL PROTECTED]> wrote: > system('rm -rf',$user_dir,$ret_val); > > On Mon, 23 Aug 2004 11:57:35 -0400, PHP Junkie <[EMAIL PROTECTED]> wrote: >> Ave, >> >> I do not really know what the problem is because I don't get an error, and >> in fact my scripts execute fine... Except that, niether is the directory >> deleted, nor is the file deleted. Only corresponding database entries are >> deleted which I specify in my SQL code. >> >> There are 2 different functions in 2 separate places in my File Manager. >> 1 function deletes the User including his Folder >> The other deletes a particular file. >> >> The code I'm using to delete the User & his Folder is: >> >> > if($delete_user) { >> $db = mysql_connect("localhost","usr","pwd"); >> mysql_select_db("mydb",$db); >> $sql = "DELETE FROM user where login = '$user'"; >> $result = mysql_query($sql) or die("There is a problem."); >> $sql2 = "DELETE FROM file where login = '$user'"; >> $result2 = mysql_query($sql2) or die("There is a problem."); >> rmdir (imsafm/$user); >> echo "User $user deleted."; >> } >> ?> >> >> The name of Folder of a user is the same as his Login. >> Anyhow... The above code doesn¹t generate any error, and in fact does delete >> the database entries from the table... But it doesn¹t remove the user¹s >> directory. Why is that? >> >> Similarly, this is the code for deleting the file: >> >> > $db = mysql_connect("localhost","usr","pwd"); >> mysql_select_db("mydb",$db); >> $sql = "DELETE FROM file where ID = '$ID'"; >> $result = mysql_query($sql) or DIE("Cannot Do!"); >> unlink($P/$F); >> echo "File Deleted"; >> ?> >> >> Again, no error... The entries in the table get deleted.. But file remains >> in the directory. >> >> Any suggestions? >> >> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] readfile()
On Mon, 2004-08-23 at 15:35, Aaron Todd wrote: > Not too familure with a chroot'd web setup and I dont know if my ISP has > some security that I dont know about. I tried some tests with file_exists() > and it doesnt seemt to be able to get to the files either. I've put in an > info request to my ISP but they are usually not much help with something > this advanced. Is there anything else I can do to further diagnose this > problem? Show them the results of your file_exists() tests. They will either fix it or explain to you why it is that way. You might also ask them if they have any specific PHP functions disabled. -- Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to add zlib support
Hi , On March 9th this year I 've compiled and installed php 4.3.4 on SuSe linux Server with apache 1.3. The configure command was this: './configure' '--with-mysql' '--with-apxs=/usr/local/apache/bin/apxs' '-enable-dbase' Nowadays I'm urged to install zlib support in order to let the developers to make use of compressed files. It's a requisite that the compression library has to be zlib. I don't know how to do that. I guess I should reconfigure with './configure' '--with-mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-zlib' '-enable-dbase' then run ./make and ./make install But I'm afraid tha something could go wrong and end-up with a whole useless installation Could someone point me in the right direction? Thanks Mauricio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Upload script not working
Thanks, I better check the file type first then... strip_tags on a PDF file is a bad idea. strip_tags() is only meant for text files that may contain HTML tags that you want to remove... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] system command
I an trying to add virus scanning to the file upload section of our portal using uvscan. The virus scanning is working properly using a system call , but I am having problems with formatting the output. I need to check the return value and if it is not a 0, I want to create a custom message. The problem is, when using system the output of the call is flushed to the browser before I can write the custom message so I have the uvscan message and then my custom message. This is my code. $uvscan_cmd = "/usr/local/bin/uvscan " . $_FILES['file']['tmp_name']; $output = system("$uvscan_cmd" , $retval); if ( $retval != 0) { print "A virus was found in your file $output"; exit; } This results in the following sent to the browser. /var/tmp/phpBFaaIa Found the W32/[EMAIL PROTECTED] virus !!! A virus was found in your file. Found the W32/[EMAIL PROTECTED] virus !!! How can get rid of the first line and still have data $output? I tried adding a 2 > &1 to the system call and tried redirecting the output to /dev/null. This got rid of the first line but also resulted in $output not having an output. -- Ron Clark System Administrator/Web Coordinator Armstrong Atlantic State University -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem connecting to Postgres
On Tuesday 24 August 2004 02:42, Joshua Capy wrote: > Ok next stupid question > > At the command line how to I force the execution of the 4.3.6 apache > version or change the default to it. What one usually does is compile different 'versions' of php using the same config options (if you want them to have the same functionality). The most common case would be to compile an apache module version, and CLI version. You can in fact compile and install both in one operation but I prefer to separate them so I can specify different php.ini for each. All the boring details are in the manual. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* You had some happiness once, but your parents moved away, and you had to leave it behind. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
On Tuesday 24 August 2004 01:55, PHP Junkie wrote: > I do have the original permission set to CHMOD 777 thus the uploads are > working fine. > > I had presumed that anything uploaded by the server is owned by it thus I > wouldn't have to interfere with the permissions thereafter... But somehow > that doesn't seem to be working out. > > I did actually set the permissions for group "nobody" to 'Read & Write'... > But I'm still there. The Files or Folders are not getting deleted. In order for a user to delete a file they must have: 1) 'x' permission for all directories in the path 2) 'wx' permission for the directory containing the file NB the permissions on the files themselves are irrelevant. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The meta-Turing test counts a thing as intelligent if it seeks to devise and apply Turing tests to objects of its own creation. -- Lew Mammel, Jr. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
On Tuesday 24 August 2004 02:32, John Nichel wrote: > Jason Wong wrote > > > phpinfo() is your friend. > > I thought phpinfo() was *MY* friend??? ;) Don't worry it's a one-to-many relationship. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Women reason with the heart and are much less often wrong than men who reason with the head. -- DeLescure */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Select List PHP,HTML
Thanks a lot, that worked perfectly. "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [snip] I have been able to create a list with no problem, but now I need to get the value of which item is selected in the list. I looked around, but couldn't find anywhere that would let me do this. Here's my code to build the list. Open($dsn); $rs = $db->Execute("SELECT * from company"); while (!$rs->EOF) { $Name = $rs->Fields['Name']->Value; print "".$Name; $rs->MoveNext(); } ?> I would appreciate any help I could get with this. [/snip] echo $_POST['Company List']; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload script not working
From: "Lizet Peña de Sola" <[EMAIL PROTECTED]> Hello Jones, thanks for looking at the code, will try the uploading without stripping the tags, I've tried with pdf files without success. strip_tags on a PDF file is a bad idea. strip_tags() is only meant for text files that may contain HTML tags that you want to remove... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select List PHP,HTML
[snip] I have been able to create a list with no problem, but now I need to get the value of which item is selected in the list. I looked around, but couldn't find anywhere that would let me do this. Here's my code to build the list. Open($dsn); $rs = $db->Execute("SELECT * from company"); while (!$rs->EOF) { $Name = $rs->Fields['Name']->Value; print "".$Name; $rs->MoveNext(); } ?> I would appreciate any help I could get with this. [/snip] echo $_POST['Company List']; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Select List PHP,HTML
Hello everyone, I have been able to create a list with no problem, but now I need to get the value of which item is selected in the list. I looked around, but couldn't find anywhere that would let me do this. Here's my code to build the list. Open($dsn); $rs = $db->Execute("SELECT * from company"); while (!$rs->EOF) { $Name = $rs->Fields['Name']->Value; print "".$Name; $rs->MoveNext(); } ?> I would appreciate any help I could get with this. Thanks, Chuck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Upload script not working
Hello again, tried to remove the last part and the script worked, it looks like strip_tags strips more than tags... Thanks a lot Lizet -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, August 23, 2004 3:02 PM To: Lizet Peña de Sola; [EMAIL PROTECTED] Subject: Re: [PHP] Upload script not working From: "Lizet Peña de Sola" <[EMAIL PROTECTED]> > I have the following script to upload files to the server, it works > partially as only a few bytes of the file are uploaded, is the script > wrong or am I missing some setting at the server? > Tia, > Lizet > > userfile=$_FILES['userfile']['tmp_name']; > // $userfile_name is the original file name without spaces > $userfile_name=str_replace(" ","_",$_FILES['userfile']['name']); > // $userfile_size the size in bytes > $userfile_size=$_FILES['userfile']['size']; > //$userfile_type is mime type e.g. image/gif > $userfile_type=$_FILES['userfile']['type']; > // $userfile_error is any error encountered > $userfile_error=$_FILES['userfile']['error']; > if($userfile_error > 0){ > $str="Problem: "; > switch ($userfile_error){ > case 1: $str=$str."error 1"; break; > case 2: $str=$str."error2"; break; > case 3: $str=$str."erro3"; break; > case 4: $str=$str."error4"; break; > } > exit; > } > $upfile= 'files/'.$userfile_name; $temp1=is_uploaded_file($userfile); > if($temp1){ >$temp2=move_uploaded_file($userfile,$upfile); >if(!$temp2){ > $str="Problem: The file could not be moved."; > //exit; > } > > } > else{ >$str="Problem: file corrupted: ".$userfile_name; > } > //reformat the file contents: > $fp= fopen($upfile,'r'); > $contents = fread($fp, filesize($upfile)); > fclose($fp); > > $contents= strip_tags($contents); > $fp= fopen($upfile,'w'); > fwrite($fp,$contents); > fclose($fp); I don't notice anything wrong with the script after glancing through it. If you take out the end portion where you strip the tags from the file, so you still end up with a smaller file as a result? Maybe strip_tags() is removing more content than you think it is? Either way, you're going to end up with a smaller file. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
I guess phpinfo() is *OUR* friend!! Great guy! Although I'd be happier if my files & folders started getting deleted with the script, which still ain't happening. On 8/23/04 2:32 PM, "John Nichel" <[EMAIL PROTECTED]> wrote: > Jason Wong wrote >> phpinfo() is your friend. >> > > I thought phpinfo() was *MY* friend??? ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Upload script not working
Hello Jones, thanks for looking at the code, will try the uploading without stripping the tags, I've tried with pdf files without success. Lizet -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, August 23, 2004 3:02 PM To: Lizet Peña de Sola; [EMAIL PROTECTED] Subject: Re: [PHP] Upload script not working From: "Lizet Peña de Sola" <[EMAIL PROTECTED]> > I have the following script to upload files to the server, it works > partially as only a few bytes of the file are uploaded, is the script > wrong or am I missing some setting at the server? > Tia, > Lizet > > userfile=$_FILES['userfile']['tmp_name']; > // $userfile_name is the original file name without spaces > $userfile_name=str_replace(" ","_",$_FILES['userfile']['name']); > // $userfile_size the size in bytes > $userfile_size=$_FILES['userfile']['size']; > //$userfile_type is mime type e.g. image/gif > $userfile_type=$_FILES['userfile']['type']; > // $userfile_error is any error encountered > $userfile_error=$_FILES['userfile']['error']; > if($userfile_error > 0){ > $str="Problem: "; > switch ($userfile_error){ > case 1: $str=$str."error 1"; break; > case 2: $str=$str."error2"; break; > case 3: $str=$str."erro3"; break; > case 4: $str=$str."error4"; break; > } > exit; > } > $upfile= 'files/'.$userfile_name; $temp1=is_uploaded_file($userfile); > if($temp1){ >$temp2=move_uploaded_file($userfile,$upfile); >if(!$temp2){ > $str="Problem: The file could not be moved."; > //exit; > } > > } > else{ >$str="Problem: file corrupted: ".$userfile_name; > } > //reformat the file contents: > $fp= fopen($upfile,'r'); > $contents = fread($fp, filesize($upfile)); > fclose($fp); > > $contents= strip_tags($contents); > $fp= fopen($upfile,'w'); > fwrite($fp,$contents); > fclose($fp); I don't notice anything wrong with the script after glancing through it. If you take out the end portion where you strip the tags from the file, so you still end up with a smaller file as a result? Maybe strip_tags() is removing more content than you think it is? Either way, you're going to end up with a smaller file. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload script not working
From: "Lizet Peña de Sola" <[EMAIL PROTECTED]> I have the following script to upload files to the server, it works partially as only a few bytes of the file are uploaded, is the script wrong or am I missing some setting at the server? Tia, Lizet userfile=$_FILES['userfile']['tmp_name']; // $userfile_name is the original file name without spaces $userfile_name=str_replace(" ","_",$_FILES['userfile']['name']); // $userfile_size the size in bytes $userfile_size=$_FILES['userfile']['size']; //$userfile_type is mime type e.g. image/gif $userfile_type=$_FILES['userfile']['type']; // $userfile_error is any error encountered $userfile_error=$_FILES['userfile']['error']; if($userfile_error > 0){ $str="Problem: "; switch ($userfile_error){ case 1: $str=$str."error 1"; break; case 2: $str=$str."error2"; break; case 3: $str=$str."erro3"; break; case 4: $str=$str."error4"; break; } exit; } $upfile= 'files/'.$userfile_name; $temp1=is_uploaded_file($userfile); if($temp1){ $temp2=move_uploaded_file($userfile,$upfile); if(!$temp2){ $str="Problem: The file could not be moved."; //exit; } } else{ $str="Problem: file corrupted: ".$userfile_name; } //reformat the file contents: $fp= fopen($upfile,'r'); $contents = fread($fp, filesize($upfile)); fclose($fp); $contents= strip_tags($contents); $fp= fopen($upfile,'w'); fwrite($fp,$contents); fclose($fp); I don't notice anything wrong with the script after glancing through it. If you take out the end portion where you strip the tags from the file, so you still end up with a smaller file as a result? Maybe strip_tags() is removing more content than you think it is? Either way, you're going to end up with a smaller file. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem connecting to Postgres
[snip] At the command line how to I force the execution of the 4.3.6 apache version or change the default to it. [/snip] You need to install the proper CLI version as described http://www.php.net/manual/en/features.commandline.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload script not working
Hi all: I have the following script to upload files to the server, it works partially as only a few bytes of the file are uploaded, is the script wrong or am I missing some setting at the server? Tia, Lizet userfile=$_FILES['userfile']['tmp_name']; // $userfile_name is the original file name without spaces $userfile_name=str_replace(" ","_",$_FILES['userfile']['name']); // $userfile_size the size in bytes $userfile_size=$_FILES['userfile']['size']; //$userfile_type is mime type e.g. image/gif $userfile_type=$_FILES['userfile']['type']; // $userfile_error is any error encountered $userfile_error=$_FILES['userfile']['error']; if($userfile_error > 0){ $str="Problem: "; switch ($userfile_error){ case 1: $str=$str."error 1"; break; case 2: $str=$str."error2"; break; case 3: $str=$str."erro3"; break; case 4: $str=$str."error4"; break; } exit; } $upfile= 'files/'.$userfile_name; $temp1=is_uploaded_file($userfile); if($temp1){ $temp2=move_uploaded_file($userfile,$upfile); if(!$temp2){ $str="Problem: The file could not be moved."; //exit; } } else{ $str="Problem: file corrupted: ".$userfile_name; } //reformat the file contents: $fp= fopen($upfile,'r'); $contents = fread($fp, filesize($upfile)); fclose($fp); $contents= strip_tags($contents); $fp= fopen($upfile,'w'); fwrite($fp,$contents); fclose($fp); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem connecting to Postgres
Ok next stupid question At the command line how to I force the execution of the 4.3.6 apache version or change the default to it. On Aug 23, 2004, at 2:39 PM, Jay Blanchard wrote: [snip] Yes I have found that I am running v 4.3.2 on the command line and 4.3.6 under apache Is it possible to run the same version both on the command line and running on apache? [/snip] Yes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem connecting to Postgres
[snip] Yes I have found that I am running v 4.3.2 on the command line and 4.3.6 under apache Is it possible to run the same version both on the command line and running on apache? [/snip] Yes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem connecting to Postgres
Yes I have found that I am running v 4.3.2 on the command line and 4.3.6 under apache Is it possible to run the same version both on the command line and running on apache? On Aug 23, 2004, at 12:23 PM, Michal Migurski wrote: I am a newby having a configuration problem. I am using PHP 4.3.6 and postgres 7.4.3 The problem is when I try to execute my php scripts that connect to postgres from the command line I get error like this: Fatal error: Call to undefined function: pg_connect() in /Users/jcapy2/Sites/Jesper/SyncPosgresToMbrMaxData .php on line 28 But it works fine from a browser using apache. The version of PHP used by Apache may not necessarily have been configured the same way as the one you're using on the command line. Try phpinfo() to determine what's there, and recompile/reinstall if you're lacking PG support. Or, try to find the command line instance that corresponds to the apache module you're using. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
Jason Wong wrote phpinfo() is your friend. I thought phpinfo() was *MY* friend??? ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
On Tuesday 24 August 2004 00:34, PHP Junkie wrote: > How do I find out which user/group my web server is running as? > I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. > I can change the user/group permissions... But which user/group does the > web server use? phpinfo() is your friend. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Absence diminishes mediocre passions and increases great ones, as the wind blows out candles and fans fires. -- La Rochefoucauld */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] readfile()
On Mon, 2004-08-23 at 13:02, Aaron Todd wrote: > I'm trying to use readfile() to allow a user to download a file that is > outside of my webroot. > > webroot = /var/www/html > downloads dir = /var/www/downloads > > Here is the code that I have been using: > $file = "/var/www/downloads/test.txt"; > header("Content-Description: File Transfer"); > header("Content-Type: application/force-download"); > header("Content-Disposition: attachment; filename=".basename($file)); > readfile($file); > > This code will work if I change the path to the webroot path, but not the > downloads dir path. I get an error saying "Unable to access" and then > "failed to open stream: No such file or directory". > > I have given whe I believe is the correct rights for the downloads dir and > also the file...rwxr-xr-x for both. > > Anyone have any idea why this isnt working? Is the download directory outside a chroot'd web setup perhaps? Or maybe your provider has some security you don't know about? There are some file related functions you can debug with, like is_readable(), and file_exists(). -- Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] readfile()
I'm trying to use readfile() to allow a user to download a file that is outside of my webroot. webroot = /var/www/html downloads dir = /var/www/downloads Here is the code that I have been using: $file = "/var/www/downloads/test.txt"; header("Content-Description: File Transfer"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=".basename($file)); readfile($file); This code will work if I change the path to the webroot path, but not the downloads dir path. I get an error saying "Unable to access" and then "failed to open stream: No such file or directory". I have given whe I believe is the correct rights for the downloads dir and also the file...rwxr-xr-x for both. Anyone have any idea why this isnt working? Thanks, Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
Ave, I do have the original permission set to CHMOD 777 thus the uploads are working fine. I had presumed that anything uploaded by the server is owned by it thus I wouldn't have to interfere with the permissions thereafter... But somehow that doesn't seem to be working out. I did actually set the permissions for group "nobody" to 'Read & Write'... But I'm still there. The Files or Folders are not getting deleted. Ave. On 8/23/04 1:41 PM, "Jonathan Haddad" <[EMAIL PROTECTED]> wrote: > the chmod 666 sets the exisiting files to be edited by the server. > anything that's uploaded by the server is owned by it, and thusly can be > edited. > > as a side note, you'd have to chmod 777 the directory to be edited if > you want uploads to work. > > PHP Junkie wrote: > >> Ave, >> >> Well here's my situation... >> You see the File Manager allows users to Upload files ... Once a user >> uploads the file... It resides in a particular folder on my server. Users >> will be constantly uploading, downloading, deleting files. I can't possibly >> CHMOD 777 all the time... >> >> My question is... If I select the "nobody" group for the base folder where >> the files are stored & created... Will all the directories & files which are >> created later by the users using the website therein have the permissions to >> be deleted, if I set the permissions to read & write on that base folder? >> >> Thanks. >> >> >> >> >> On 8/23/04 12:48 PM, "Jay Blanchard" <[EMAIL PROTECTED]> >> wrote: >> >> >> >>> [snip] >>> How do I find out which user/group my web server is running as? >>> I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. >>> I can change the user/group permissions... But which user/group does the >>> web >>> server use? >>> [/snip] >>> >>> For security reasons Apache typically runs as "nobody" >>> >>> >>> >>> >> >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
the chmod 666 sets the exisiting files to be edited by the server. anything that's uploaded by the server is owned by it, and thusly can be edited. as a side note, you'd have to chmod 777 the directory to be edited if you want uploads to work. PHP Junkie wrote: Ave, Well here's my situation... You see the File Manager allows users to Upload files ... Once a user uploads the file... It resides in a particular folder on my server. Users will be constantly uploading, downloading, deleting files. I can't possibly CHMOD 777 all the time... My question is... If I select the "nobody" group for the base folder where the files are stored & created... Will all the directories & files which are created later by the users using the website therein have the permissions to be deleted, if I set the permissions to read & write on that base folder? Thanks. On 8/23/04 12:48 PM, "Jay Blanchard" <[EMAIL PROTECTED]> wrote: [snip] How do I find out which user/group my web server is running as? I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. I can change the user/group permissions... But which user/group does the web server use? [/snip] For security reasons Apache typically runs as "nobody" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
Ave, Well here's my situation... You see the File Manager allows users to Upload files ... Once a user uploads the file... It resides in a particular folder on my server. Users will be constantly uploading, downloading, deleting files. I can't possibly CHMOD 777 all the time... My question is... If I select the "nobody" group for the base folder where the files are stored & created... Will all the directories & files which are created later by the users using the website therein have the permissions to be deleted, if I set the permissions to read & write on that base folder? Thanks. On 8/23/04 12:48 PM, "Jay Blanchard" <[EMAIL PROTECTED]> wrote: > [snip] > How do I find out which user/group my web server is running as? > I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. > I can change the user/group permissions... But which user/group does the > web > server use? > [/snip] > > For security reasons Apache typically runs as "nobody" > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I open Save As Dialog Box?
Ave, Yes indeed that's what it's doing. But that's ok... My main concern was for Windows users because that's the majority of the users for this application. Thanks. On 8/23/04 12:50 PM, "Jonathan Haddad" <[EMAIL PROTECTED]> wrote: > In Safari it'll download the file and then open it. > > Jon > > PHP Junkie wrote: > >> Ave, >> >> IT WORKS!! >> There wasn't one bit of a problem.. >> I'll just paste the code here again for anyone who might be looking for it. >> I guess I was very close to it but just doing one thing wrong... I wasn't >> specifying the Basename directive. >> >> > $file = "$P/$F"; >> header("Content-Description: File Transfer"); >> header("Content-Type: application/force-download"); >> header("Content-Disposition: attachment; filename=".basename($file)); >> @readfile($file); >> ?> >> >> Although this doesn't work on MAC... It works on Windows .. In Mac it still >> opens up the file in it's supported software. But it's not an issue for me. >> >> Thanks a ton guys... >> >> >> >> On 8/23/04 10:51 AM, "John Holmes" <[EMAIL PROTECTED]> wrote: >> >> >> >>> From: "PHP Junkie" <[EMAIL PROTECTED]> >>> >>> >>> I have created a File Manager Application for my company which has a place where authorized users can download the stored files. The files are of various MIME Types.. Mainly PDF, TXT & DOC. What I want to do is basically... When the user clicks on the Download Button... The Save As Dialog Box should appear... What is happening right now is that the file opens in it's related software (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's native software. I know I need to use the header ("Content-type: application/octet-stream"); But I don't know how. >>> Read the first comment here: http://us4.php.net/readfile >>> >>> ---John Holmes... >>> >>> >> >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
PHP Junkie wrote: Ave, How do I find out which user/group my web server is running as? I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. I can change the user/group permissions... But which user/group does the web server use? Default setup? Probably nobody/nobody. Check your httpd.conf (at least for Apache 1.3.x, I don't know where it's set for Apache 2). Read up on user/group on the Apache website. http://httpd.apache.org -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I open Save As Dialog Box?
In Safari it'll download the file and then open it. Jon PHP Junkie wrote: Ave, IT WORKS!! There wasn't one bit of a problem.. I'll just paste the code here again for anyone who might be looking for it. I guess I was very close to it but just doing one thing wrong... I wasn't specifying the Basename directive. $file = "$P/$F"; header("Content-Description: File Transfer"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=".basename($file)); @readfile($file); ?> Although this doesn't work on MAC... It works on Windows .. In Mac it still opens up the file in it's supported software. But it's not an issue for me. Thanks a ton guys... On 8/23/04 10:51 AM, "John Holmes" <[EMAIL PROTECTED]> wrote: From: "PHP Junkie" <[EMAIL PROTECTED]> I have created a File Manager Application for my company which has a place where authorized users can download the stored files. The files are of various MIME Types.. Mainly PDF, TXT & DOC. What I want to do is basically... When the user clicks on the Download Button... The Save As Dialog Box should appear... What is happening right now is that the file opens in it's related software (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's native software. I know I need to use the header ("Content-type: application/octet-stream"); But I don't know how. Read the first comment here: http://us4.php.net/readfile ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with Mcrypt - encoding works, but decoding hangs
Hi all, I'm in the process of writing a script that will accept credit cards through a secure html form, and then encrypt them using MCRYPT_RIJNDAEL_256 and store them in my mysql database. When I run the following code snippet, nothing is returned through the server - the connection is established, but the server appears to be hanged. Through a process of commenting and uncommenting lines, I've discovered that the decrypting line is causing the problem. '; $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256,$key,$ccno,MCRYPT_MODE_CBC,$iv); echo 'Encrypted: ' . bin2hex ($encrypted) . ''; echo 'Encrypted base64: ' . base64_encode($encrypted) . ''; $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC),MCRYPT_RAND); $newccno = mcrypt_decrypt(MCRYPT_RIJNDAEL_256,$key,$encrypted,MCRYPT_MODE_CBC,$iv); echo 'Decrypted: ' . $newccno . ''; echo 'Decrypted trimmed: ' . trim($newccno) . ''; ?> (in the above code block, if I comment out the mcrypt_decrypt line, everything works fine) Note - this *was* just installed on my webhost by my request - there could have been an installation error. The files and instructions used were the windows binaries at www.php.net/mcrypt . If you think this question could be better answered on php-windows, please let me know :) Any suggestions? :) Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
PHP probably does not have permission to change those files. chmod 777 and it should work. However now those files are writable by anyone. If you're on a shared server there could be problems later. Jon PHP Junkie wrote: Ave, I do not really know what the problem is because I don't get an error, and in fact my scripts execute fine... Except that, niether is the directory deleted, nor is the file deleted. Only corresponding database entries are deleted which I specify in my SQL code. There are 2 different functions in 2 separate places in my File Manager. 1 function deletes the User including his Folder The other deletes a particular file. The code I'm using to delete the User & his Folder is: User $user deleted."; } ?> The name of Folder of a user is the same as his Login. Anyhow... The above code doesn¹t generate any error, and in fact does delete the database entries from the table... But it doesn¹t remove the user¹s directory. Why is that? Similarly, this is the code for deleting the file: File Deleted"; ?> Again, no error... The entries in the table get deleted.. But file remains in the directory. Any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] unlink() & rmdir() ... Problems.
[snip] How do I find out which user/group my web server is running as? I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. I can change the user/group permissions... But which user/group does the web server use? [/snip] For security reasons Apache typically runs as "nobody" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
Ave, How do I find out which user/group my web server is running as? I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. I can change the user/group permissions... But which user/group does the web server use? Thanks. On 8/23/04 12:08 PM, "John Nichel" <[EMAIL PROTECTED]> wrote: > PHP Junkie wrote: >> Again, no error... The entries in the table get deleted.. But file remains >> in the directory. >> >> Any suggestions? > > Neither of these functions return an error. They will return false on > failure. Does the user/group which your web server is running as have > permission to remove these files/directories? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text from file into database
> I want to create a script that will read each line of the file and > insert it to database. I am new to php and maybe you could help me You've been posting here for *months*, how new could you be? Look up the file() function. And the docs for your database. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem connecting to Postgres
> I am a newby having a configuration problem. I am using PHP 4.3.6 and > postgres 7.4.3 > > The problem is when I try to execute my php scripts that connect to > postgres from the command line I get error like this: > > Fatal error: Call to undefined function: pg_connect() in > /Users/jcapy2/Sites/Jesper/SyncPosgresToMbrMaxData > .php on line 28 > > But it works fine from a browser using apache. The version of PHP used by Apache may not necessarily have been configured the same way as the one you're using on the command line. Try phpinfo() to determine what's there, and recompile/reinstall if you're lacking PG support. Or, try to find the command line instance that corresponds to the apache module you're using. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie behaviour
--- Michael Purdy <[EMAIL PROTECTED]> wrote: > > setcookie('cat','large',time()+3600); > setcookie('dog','small',time()+3600); > > > The outcome of this script is that only the LAST cookie is successfully > stored. This seems unlikely. It's possible that neither of these statements is successful (perhaps your script has output prior), and the only reason you think the first one is being set is because it was set from a previous test. You can rule this out by using unique names for every single test, and use something like print_r($_COOKIES) to see exactly what cookies the browser included in its request for the page. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem connecting to Postgres
Thanks On Aug 23, 2004, at 12:04 PM, Jay Blanchard wrote: [snip] Fatal error: Call to undefined function: pg_connect() in /Users/jcapy2/Sites/Jesper/SyncPosgresToMbrMaxData .php on line 28 [/snip] http://www.php.net/manual/en/features.commandline.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink() & rmdir() ... Problems.
PHP Junkie wrote: Again, no error... The entries in the table get deleted.. But file remains in the directory. Any suggestions? Neither of these functions return an error. They will return false on failure. Does the user/group which your web server is running as have permission to remove these files/directories? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem connecting to Postgres
[snip] Fatal error: Call to undefined function: pg_connect() in /Users/jcapy2/Sites/Jesper/SyncPosgresToMbrMaxData .php on line 28 [/snip] http://www.php.net/manual/en/features.commandline.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unlink() & rmdir() ... Problems.
Ave, I do not really know what the problem is because I don't get an error, and in fact my scripts execute fine... Except that, niether is the directory deleted, nor is the file deleted. Only corresponding database entries are deleted which I specify in my SQL code. There are 2 different functions in 2 separate places in my File Manager. 1 function deletes the User including his Folder The other deletes a particular file. The code I'm using to delete the User & his Folder is: User $user deleted."; } ?> The name of Folder of a user is the same as his Login. Anyhow... The above code doesn¹t generate any error, and in fact does delete the database entries from the table... But it doesn¹t remove the user¹s directory. Why is that? Similarly, this is the code for deleting the file: File Deleted"; ?> Again, no error... The entries in the table get deleted.. But file remains in the directory. Any suggestions?
Re: [PHP] Need Help for Session
Hi, Make sure that http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem connecting to Postgres
Hi, I am a newby having a configuration problem. I am using PHP 4.3.6 and postgres 7.4.3 The problem is when I try to execute my php scripts that connect to postgres from the command line I get error like this: Fatal error: Call to undefined function: pg_connect() in /Users/jcapy2/Sites/Jesper/SyncPosgresToMbrMaxData .php on line 28 But it works fine from a browser using apache. I have tried various user logins and have checked the environmental paths and all seems ok so it must be some configure problem but with what PHP or Postgres? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I open Save As Dialog Box?
Ave, IT WORKS!! There wasn't one bit of a problem.. I'll just paste the code here again for anyone who might be looking for it. I guess I was very close to it but just doing one thing wrong... I wasn't specifying the Basename directive. Although this doesn't work on MAC... It works on Windows .. In Mac it still opens up the file in it's supported software. But it's not an issue for me. Thanks a ton guys... On 8/23/04 10:51 AM, "John Holmes" <[EMAIL PROTECTED]> wrote: > From: "PHP Junkie" <[EMAIL PROTECTED]> > >> I have created a File Manager Application for my company which has a place >> where authorized users can download the stored files. The files are of >> various MIME Types.. Mainly PDF, TXT & DOC. >> What I want to do is basically... When the user clicks on the Download >> Button... The Save As Dialog Box should appear... >> What is happening right now is that the file opens in it's related >> software >> (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's >> native software. >> >> I know I need to use the >> header ("Content-type: application/octet-stream"); >> But I don't know how. > > Read the first comment here: http://us4.php.net/readfile > > ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reading the documentation
* Octavian Rasnita <[EMAIL PROTECTED]>: > Well, it seems that PHP libraries don't have the documentation included... > This is too bad, because it is much harder to search in the PHP manual, and > some libraries that might be downloaded from different sites and made by > different programmers won't have the documentation included in the PHP > manual. > > I thought PHP also have a kind of program like perldoc for perl which can > display the documentation for a built in function, for a library that was > installed, plus different tutorials... > > I guess it would be a good idea to implement such a thing in PHP also, > including a documentation in comments, with some special marks... Okay, what you're talking about has to do not with the standard PHP distribution but with classes and scripts created by PHP programmers. If you get them from PEAR, you will usually have documentation -- this is one of the foci of the PEAR project, standard and well-documented modules. On the other hand, if you get them from another source, you have to rely on the programmer(s) creating the documentation. There are already some standard PHP documentation systems, the most prevalent of which is PHPDocumentor (available via PEAR as well as phpdoc.org). It creates web-based documentation that you can then peruse at your leisure; for an example, look at the PEAR site's package documentation (which isn't strictly PHPDoc, but many of the package authors use PHPDoc to create their documentation). > - Original Message - > From: "M. Sokolewicz" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Sunday, August 22, 2004 11:29 AM > Subject: [PHP] Re: Reading the documentation > > >> Octavian Rasnita wrote: >> > Hi all, >> > >> > I have 2 questions: >> > >> > 1. Do PHP libraries have a documentation included inside of them like in >> > case of Perl's modules? >> > >> > 2. If yes, how can I read that documentation? >> > >> > Thank you. >> > >> > Teddy >> that would depend on what you understand under the term "PHP libraries", >> if you mean the actual C files, then no, if you mean the PHP extensions, >> eg. mysql, mcrypt, XML, etc. then yes, they do have documentation (most >> of them), which can be found in the PHP Manual available on php.net. If >> you're talking about the PECL extensions, then they usually don't have >> much, if any, documentation about it. It basically means you'd need to >> read the C code for it and find out yourself... > > >> hope that helped, >> - Tul -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] quick globalisation?
[snip] Is there a quicker way to globalise something other than: $a = 'foo'; $b = 'bah'; ... $GLOBALS['a'] = $a; $GLOBALS['b'] = $b; ?? I was hoping for something like $a = 'foo'; $b = 'bah'; ... makeGlobal('a','b') /*or*/ makeGlobal($a,$b); [/snip] According to http://us3.php.net/language.variables.scope you could do something like global $a, $b, $c, ...; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need Help for Session
> Sir, > I am afzal hussain from bangladesh. Acually i am getting some problem using session > in php. This is the sample code that i have written, > > session_start(); > $vbl="This variable is registered"; > session_register('vbl'); > echo $vbl; > ?> > it shows this output. > > > Warning: Cannot send session cookie - headers already sent by (output started at > c:/program files/abria merlin/apache/htdocs/session.php:3) in c:/program files/abria > merlin/apache/htdocs/session.php on line 4 > > Warning: Cannot send session cache limiter - headers already sent (output started at > c:/program files/abria merlin/apache/htdocs/session.php:3) in c:/program files/abria > merlin/apache/htdocs/session.php on line 4 > > Warning: open(/tmp\sess_178d4e9e23a4d7b1f061f93e7f172496, O_RDWR) failed: m (2) in > c:/program files/abria merlin/apache/htdocs/session.php on line 4 > This variable is registered > > Finding no other way i am sending this email to u. Could u pls tell me what s\could > be the problem. and How i can i solve that problem. > > thanks you very much. > afzal Hussian - Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now.
Re: [PHP] How do I open Save As Dialog Box?
Php Junkie wrote: Ave, I'm facing a little problem. I have created a File Manager Application for my company which has a place where authorized users can download the stored files. The files are of various MIME Types.. Mainly PDF, TXT & DOC. What I want to do is basically... When the user clicks on the Download Button... The Save As Dialog Box should appear... What is happening right now is that the file opens in it's related software (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's native software. I know I need to use the header ("Content-type: application/octet-stream"); But I don't know how. Can anyone help? Thanks. Try using header("Content-type: application/force-download") -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick globalisation?
Is there a quicker way to globalise something other than: $a = 'foo'; $b = 'bah'; ... $GLOBALS['a'] = $a; $GLOBALS['b'] = $b; ?? I was hoping for something like $a = 'foo'; $b = 'bah'; ... makeGlobal('a','b') /*or*/ makeGlobal($a,$b); --- Justin French http://indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I open Save As Dialog Box?
"Php Junkie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ave, > > I'm facing a little problem. > I have created a File Manager Application for my company which has a place > where authorized users can download the stored files. The files are of > various MIME Types.. Mainly PDF, TXT & DOC. > What I want to do is basically... When the user clicks on the Download > Button... The Save As Dialog Box should appear... > What is happening right now is that the file opens in it's related software > (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's > native software. > > I know I need to use the > header ("Content-type: application/octet-stream"); > But I don't know how. > > Can anyone help? > > Thanks. Take a look at PEAR's HTTP_Download: http://pear.php.net/package/HTTP_Download This package is exactly what you are looking for. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php4 classes, extending same class
* Mnp <[EMAIL PROTECTED]>: > I have the following classes being inherited: > > User extends School > > I have two classes: > Profile extends User > and > Buddies extends User > > being used in the same .php file. I get a "Fatal error: Cannot > redeclare class school in ..." > > > I can see why this is happening but three questions, > > 1. Does php5 allow for multiple extends? e.g. Profile extends User > extends School I don't believe so; however you can read for yourself at: http://www.zend.com/php5/articles/engine2-php5-changes.php > 2. Programmatically, how can I resolve this sort of issue besides not > using this class and making a new class with a different name? This *should* work. Are you including/requiring the user and/or school class file more than once? > 3. Is there a way to uninclude a included file? No... but if you're not using require_once or include_once when loading your libraries, you're going to see stuff like this (hence my question after your point 2). My suspicion is that you're not using require_once or include_once, and the school class file is getting loaded twice. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I open Save As Dialog Box?
PHP Junkie wrote: Ave, I'm facing a little problem. I have created a File Manager Application for my company which has a place where authorized users can download the stored files. The files are of various MIME Types.. Mainly PDF, TXT & DOC. What I want to do is basically... When the user clicks on the Download Button... The Save As Dialog Box should appear... What is happening right now is that the file opens in it's related software (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's native software. I know I need to use the header ("Content-type: application/octet-stream"); But I don't know how. Can anyone help? Thanks. http://us4.php.net/readfile -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I open Save As Dialog Box?
From: "PHP Junkie" <[EMAIL PROTECTED]> I have created a File Manager Application for my company which has a place where authorized users can download the stored files. The files are of various MIME Types.. Mainly PDF, TXT & DOC. What I want to do is basically... When the user clicks on the Download Button... The Save As Dialog Box should appear... What is happening right now is that the file opens in it's related software (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's native software. I know I need to use the header ("Content-type: application/octet-stream"); But I don't know how. Read the first comment here: http://us4.php.net/readfile ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I open Save As Dialog Box?
Ave, I'm facing a little problem. I have created a File Manager Application for my company which has a place where authorized users can download the stored files. The files are of various MIME Types.. Mainly PDF, TXT & DOC. What I want to do is basically... When the user clicks on the Download Button... The Save As Dialog Box should appear... What is happening right now is that the file opens in it's related software (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's native software. I know I need to use the header ("Content-type: application/octet-stream"); But I don't know how. Can anyone help? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookie behaviour
I am running php 5.0.1 on NT. I have a small test script as shown below setcookie('cat','large',time()+3600); setcookie('dog','small',time()+3600); The outcome of this script is that only the LAST cookie is successfully stored.despite having a different name. Is this because they are both being set from within the same script and therefore conflicting with each other? How are you tracking whether each cookie is set or not? If you have Mozilla/Firefox installed, you can install the LiveHTTPHeaders extension (http://livehttpheaders.mozdev.org/) and use it to monitor the request and response headers as you surf this page. You'll be able to see whether both set-cookie headers are being sent to the browser or not along with what cookies the browser is actually sending back. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cookie behaviour
Michael Purdy wrote: Folks I am running php 5.0.1 on NT. I have a small test script as shown below setcookie('cat','large',time()+3600); setcookie('dog','small',time()+3600); The outcome of this script is that only the LAST cookie is successfully stored.despite having a different name. Is this because they are both being set from within the same script and therefore conflicting with each other? Mike First of all, use instead of and , the latter is not always supported. Second, are you sure that you don't output any non-header information to the browser before setting the cookies? Try using output buffering: /* start output buffering */ ob_start(); /* print out something stupid (it is saved to the buffer) */ echo "mooo\n"; /* set them cookies */ setcookie("foo", "bar"); setcookie("bar", "foo"); /* it's getting even stupider (can you even say that?!) */ echo "baaah\n"; /* print the buffered output and end the output buffering */ ob_flush(); ?> Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] After upgrading PHP, Session Values not stored properly
Hi Andre, Thank you. Yes, the register_globals is set to 'on'. At 05:41 PM 8/23/2004, Andre Dubuc wrote: On your new setup, is register_globals=on by any chance? I ran into the same problem -- once set to off, everything started working properly. Just a thought, Hth Andre On Monday 23 August 2004 02:45 am, Sheni R. Meledath wrote: > Hi Gerard, > > Many thanks. We are using cookies to store the session ID. The session on > other sites are working perfectly. The same problem on this site is > experienced by other users also. Also the same log-in module was working > perfectly with the older PHP version. > > At 10:20 AM 8/23/2004, Gerard Samuel wrote: > >Sheni R. Meledath wrote: > >>session.use_trans_sid On On > > > >Im currently running FBSC 4.10/php 4.3.6, and the only difference with our > >session setup is session.use_trans_sid. > >Mine is off. > >For sessions to get lost means that either > >a) You have cookies disabled in the browser > >b) You are not using the SID constant in links/or not using > >session.use_trans_sid > > > >So are you using cookies? If you accept cookies, are cookies stored in > >the browser? > >If you are not using cookies, are you manually adding the SID constant to > >links, or is session.use_trans_sid actually working by adding the session > >id to your links (check the source of the page)? > > Regards > Sheni R Meledath > [EMAIL PROTECTED] Regards Sheni R Meledath [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class Con- and Destructor Inheritance
Curt Zirzow wrote: * Thus wrote Justin Patrin: On Sun, 22 Aug 2004 13:04:11 +0200, Daniel Schierbeck <[EMAIL PROTECTED]> wrote: ... Note: Parent constructors are not called implicitly. In order to run a parent constructor, a call to parent::__construct() is required. Is this an error in the manual or in PHP itself? Should I report it somewhere? No, this is not a bug. This means that if you define a new constructor / destructor, the parent class's won't be called unless you put it in the new ones. Although not a bug, it is a little misleading, i've corrected it to explain when the constructor isn't called. Curt Thanks, all i needed to know :) The manual's a bit confusing on that part... Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] After upgrading PHP, Session Values not stored properly
On your new setup, is register_globals=on by any chance? I ran into the same problem -- once set to off, everything started working properly. Just a thought, Hth Andre On Monday 23 August 2004 02:45 am, Sheni R. Meledath wrote: > Hi Gerard, > > Many thanks. We are using cookies to store the session ID. The session on > other sites are working perfectly. The same problem on this site is > experienced by other users also. Also the same log-in module was working > perfectly with the older PHP version. > > At 10:20 AM 8/23/2004, Gerard Samuel wrote: > >Sheni R. Meledath wrote: > >>session.use_trans_sid On On > > > >Im currently running FBSC 4.10/php 4.3.6, and the only difference with our > >session setup is session.use_trans_sid. > >Mine is off. > >For sessions to get lost means that either > >a) You have cookies disabled in the browser > >b) You are not using the SID constant in links/or not using > >session.use_trans_sid > > > >So are you using cookies? If you accept cookies, are cookies stored in > >the browser? > >If you are not using cookies, are you manually adding the SID constant to > >links, or is session.use_trans_sid actually working by adding the session > >id to your links (check the source of the page)? > > Regards > Sheni R Meledath > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Error message
define constant with "DB_PORTABILITY_ALL"; Pete wrote: > Hi List, > > I am getting a strange error notice for the following config file: > > /** > * Database > */ > $dsn = array( > 'phptype' => 'mysql', > 'username' => 'root', > 'password' => 'secretpass', > 'hostspec' => 'localhost', > 'database' => 'mydb', > ); > > $options = > array( > 'debug' => 2, > 'portability' => DB_PORTABILITY_ALL, > ); > > /** > * Language options > */ > $languages = array('de', 'en', 'it', 'fr', 'es', 'el', 'nl'); >> > > > Notice: Use of undefined constant DB_PORTABILITY_ALL - assumed > 'DB_PORTABILITY_ALL' in D:\utf8php5\config.php on line 16 > > What can I do about this? > > Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error message
> Notice: Use of undefined constant DB_PORTABILITY_ALL - assumed 'DB_PORTABILITY_ALL' > in D:\utf8php5\config.php on line 16 > > What can I do about this? include PEAR::DB before you include this config file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Error message
[snip] Notice: Use of undefined constant DB_PORTABILITY_ALL - assumed 'DB_PORTABILITY_ALL' in D:\utf8php5\config.php on line 16 What can I do about this? [/snip] http://www.php.net/constant DEFINE the constant DB_PORTABILITY_ALL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error message
Hi List, I am getting a strange error notice for the following config file: 'mysql', 'username' => 'root', 'password' => 'secretpass', 'hostspec' => 'localhost', 'database' => 'mydb', ); $options = array( 'debug' => 2, 'portability' => DB_PORTABILITY_ALL, ); /** * Language options */ $languages = array('de', 'en', 'it', 'fr', 'es', 'el', 'nl'); ?> Notice: Use of undefined constant DB_PORTABILITY_ALL - assumed 'DB_PORTABILITY_ALL' in D:\utf8php5\config.php on line 16 What can I do about this? Thank you very much.
Re: [PHP] downloading files
I did exactly what you said but its not working for me. I am getting the following error: Warning: filesize(): SAFE MODE Restriction in effect. The script whose uid is 20373 is not allowed to access /var/www owned by uid 0 in /home/virtual/site341/fst/var/www/html/test.php on line 3 I checked the rights and it its exactly what it should be...rwxr-xr-x...for all the directories leading to the download directory and all the files in the directory. Is this SAFEMODE error normal or is something turned on in that I need to turn off? Thanks, Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Clear HTTP POST value
From: "Nicklas Bondesson" <[EMAIL PROTECTED]> Didn't work for me (PHP 4.3.9 + Apache 2.0.4). I will try the other method you suggested. Can you define "didn't work" for us? Are you saying that if $_POST['foo'] has a value of bar, that: echo $_POST['foo']; unset($_POST['foo']); echo $_POST['foo']; displays "bar" twice? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Clear HTTP POST value
Didn't work for me (PHP 4.3.9 + Apache 2.0.4). I will try the other method you suggested. Nicke -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: den 23 augusti 2004 13:41 To: [EMAIL PROTECTED] Subject: [PHP] Re: Clear HTTP POST value "Nicklas Bondesson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! > > Is there a smooth way to clear a posted value on a page? I have tried > the following without sucess. > > unset($_POST["var"]); > unset($HTTP_POST_VARS["var"]); > > Nicke Hi Nicke, unset($_POST['var']) *should* work - it works for me (PHP 4.3.8). You could also do $_POST = array() to reset all values. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ... extendet library ...
Hi all, I just starting with php, and i hawe problem with Bzip2 library. I will using this library, but when I use function "bzcompress()" in the editor ZDE (Zend Development Enviroment 3.0.2), this editor write text "Call to undefined function: bzcompress() ... ". Example: In help this function it's in section "INSTALL" information this text: "You will need to use the --with-bz2[=DIR] configuration option when compiling PHP to enable bzip2 support." Must I this funkcions aktivated? Where (file) I must write this text, and how? (Please example). PS: I hawe Apache2.0.50 and PHP5.0.1, from instal-packed "XAMPP BASIC package 1.4.6" Thanks, ... kofi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Clear HTTP POST value
"Nicklas Bondesson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! > > Is there a smooth way to clear a posted value on a page? I have tried the > following without sucess. > > unset($_POST["var"]); > unset($HTTP_POST_VARS["var"]); > > Nicke Hi Nicke, unset($_POST['var']) *should* work - it works for me (PHP 4.3.8). You could also do $_POST = array() to reset all values. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Gd Library error compiling
Curt Zirzow wrote: * Thus wrote Martin Visser: PHP5, with GD on Linux (Slackware 10.0) ./configure goes just fine, but when I try 'make', there's an error. this is how I configured it: ./configure --prefix=/usr/local/php5 --with-zlib --with-pear=/usr/share/pear --with-mysql=/usr/local/mysql --includedir=/usr/include --without-sqlite --disable-cgi --with-apxs2=/usr/local/apache2/bin/apxs --with-freetype-dir=/usr/include/freetype2 --enable-gd-native-tt --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-xpm-dir=/usr/local/lib --with-gd=/usr/local/include ... this is the error I get when I 'make' the configuration: + (everything above this contains no errors) ext/gd/gd.lo(.text+0x1be8): In function `zif_imagecolormatch': /usr/local/php5/ext/gd/gd.c:902: undefined reference to `gdImageColorMatch' This is usually due to header and library mismatch from my exprirence. ... I tried to compile PHP with only --with-gd (without --with-jpeg-dir etc) and than I get an error: Fatal error: Call to undefined function imagecreatefromjpeg() does anyone know how to solve this problem? did you try it with: configure --with-gd or configure --with-gd=/usr/... You can leave in the --with-jpeg-dir directives, it simply sounds like you have mulitple versions (gd1 and gd2) on your system and things are getting confused when it gets compiled. Curt I can't find any other gd libraries besides gd2, but how can I be certain about that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to get a unique series of numbers?
Hello, > I would take each number and place it in an array. > Then for each Thank you very much. It has been really very helpful for me. Vous manquez despace pour stocker vos mails ? Yahoo! Mail vous offre GRATUITEMENT 100 Mo ! Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/ Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Clear HTTP POST value
Hi! Is there a smooth way to clear a posted value on a page? I have tried the following without sucess. unset($_POST["var"]); unset($HTTP_POST_VARS["var"]); Nicke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookie behaviour
Folks I am running php 5.0.1 on NT. I have a small test script as shown below setcookie('cat','large',time()+3600); setcookie('dog','small',time()+3600); The outcome of this script is that only the LAST cookie is successfully stored.despite having a different name. Is this because they are both being set from within the same script and therefore conflicting with each other? Mike
[PHP] just another question
Arzed wrote: Hy! I have a relative simple question about mysqli_prepare: When I prepare a statement and then bind parameters to it, does php automatically care for escaping strings etc.? Example: prepare("SELECT FROM table WHERE x=?"); $p = "5'" $stmt->bind_param("i",$p); # is "5'" converted to 5 like it would when i use intval($p)? $stmt->reset(); $s = "'xyz' || x LIKE '%'"; $stmt->bind_param("s",$s); # will those "'" be escaped? ?> thanks for help So it seems, that nobody knows what happens with those binded parameters. Is there a more precise documentation on the mysqli-object interface? Is there any code snipped that shows how the mysqli-classes would look like, when they were coded in php, like there is for the Extension class? aRZed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php