Re: [PHP] Function with Optional Arguments
check this link simple example http://perl.about.com/library/weekly/aa121002c.htm On Wed, 21 Jul 2004 13:39:32 -0500, Alex Hogan [EMAIL PROTECTED] wrote: Hi All, How do I write a function with optional arguments? Is it possible in php? function myfunc($First, $Second,[$Third, $Fourth]){ some stuff here } alex hogan * The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. The views stated herein do not necessarily represent the view of the company. If you are not the intended recipient of this e-mail you may not copy, forward, disclose, or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_POST v4.3 to v5.0
I wonder why do you need script language=php /script try without that On Wed, 14 Jul 2004 23:17:01 +1000, Michael Purdy [EMAIL PROTECTED] wrote: Folks I appreciate the answers received previously in relation to my 4,3 to 5.0 question regarding $_REQUEST $_POST etc.. Unfortunately I am still no further advanced on solving the problem. Clearly the value from the form is not being passed to the script in 5.x, but being very new to PHP and I am not sure why. Here are my two scripts which I created for testing purposes and which run fine under 4.3.x # SENDING SCRIPT 1.php script language=php echo 'form method=POST action=2.php'; echo 'pInput a Test Variable input type=text name=testvar size=20/p'; echo 'pinput type=submit value=Submit name=Buttoninput type=reset value=Reset name=B2/p'; echo '/form'; /script RECEIVING SCRIPT ### 2.php script language=php $searchtype = $_POST['testvar']; echo $searchtype; /script I still receive a error Notice: Undefined index: testvar in e:\WC5\http\cgi\2.php on line 3 PHP Notice: Undefined index: testvar in e:\WC5\http\cgi\2.php on line 3 Is there anything in the php.ini v5 file that maybe causing me problems. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP on MAC
You should not comment, if you do so you cant start apache at all I wonder why the tutorial say that -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] word count on record insertion
Did you try calling the word counter function in the onChange event of textbox and truncate the characters/words -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MYSQL Query results in pages
No other way. Use one query to count the total record and then another query for limiting -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finding duplicates in arrays
use array_unique http://us4.php.net/manual/en/function.array-unique.php On Thu, 24 Jun 2004 10:33:04 -0800, Chris Lott [EMAIL PROTECTED] wrote: Given two arrays, I want to find the records which are duplicates. What is the simplest approach? And should I use a different approach to compare three or more arrays to find only duplicates that occur in all of them? c -- Chris Lott -- 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] Filesize
the file should be in he same folder as that of the php script, otherwise you have to mention the absolute/relative path Geethanandh On Wed, 23 Jun 2004 15:06:52 -0500, Jay Blanchard [EMAIL PROTECTED] wrote: Boy you'd think that this would be simple, but I get no filesize with the following for($i = 4; $i count($arrDirectory); $i++){ if(is_dir($arrDirectory[$i])){ if($theDir = opendir($arrDirectory[$i])){ while(($theFile = readdir($theDir)) !== FALSE){ $theSize = filesize($theFile); echo $theFile . \t . $theSize . \n; } } fclose($theDir); } } Heck, I even get some warnings... PHP Warning: filesize(): Stat failed for cw.tol.1040606180942.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 PHP Warning: filesize(): Stat failed for cw.tol.1040607181154.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 cw.acc.1040605182621.txt.gz cw.acc.1040606182502.txt.gz cw.acc.1040607182719.txt.gz cw.tol.1040519181155.txt.gz Have I gone loopy? Wait, don't answer that. Do I need to do something else to get the file size? I have read and searched, but to no avail yet. TIA! -- 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] Filesize
while(($theFile = readdir($theDir)) !== FALSE){ != not !== On Wed, 23 Jun 2004 15:06:52 -0500, Jay Blanchard [EMAIL PROTECTED] wrote: Boy you'd think that this would be simple, but I get no filesize with the following for($i = 4; $i count($arrDirectory); $i++){ if(is_dir($arrDirectory[$i])){ if($theDir = opendir($arrDirectory[$i])){ while(($theFile = readdir($theDir)) !== FALSE){ $theSize = filesize($theFile); echo $theFile . \t . $theSize . \n; } } fclose($theDir); } } Heck, I even get some warnings... PHP Warning: filesize(): Stat failed for cw.tol.1040606180942.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 PHP Warning: filesize(): Stat failed for cw.tol.1040607181154.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 cw.acc.1040605182621.txt.gz cw.acc.1040606182502.txt.gz cw.acc.1040607182719.txt.gz cw.tol.1040519181155.txt.gz Have I gone loopy? Wait, don't answer that. Do I need to do something else to get the file size? I have read and searched, but to no avail yet. TIA! -- 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