Re: Re[2]: [PHP] Passing many valaues to function
which is line 235? Daniel Harik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have following code ? class Member{ function vallidateForm ($HTTP_POST_VARS){ echo $HTTP_POST_VARS['frmUsername']; } } $user = new Member; if($action==register){ $user-vallidateForm($HTTP_POST_VARS); }else{ $user-displayForm(); } Why i try to run it i get error Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\program files\apache group\apache\htdocs\cms\member.php on line 235 Thank you very much -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Deleting Array elements
One idea is to read the file into an array, use substr to match the existance of the user to be deleted, and if the user isn't to be deleted, read the line into a new array, then write the new file to the array. Hew Staff [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm looking for some code that will enable me to remove a line from a file. I have .htaccess which is being filled by a subscription processor, I need to know how to remove a user from this file once the subscription has either been cancelled or subscription term complete. Any help appreciated. Thanks Jonno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Help with an error I can't find!
Sounds like $HTTP_POST_VARS is not a valid array (to check do if(is_array($HTTP_POST_VARS)) { print YUP; } else { print NOPE; }) Check to make sure that track_vars is turned on in the PHP.ini. Lic. Carlos A. Triana Torres [EMAIL PROTECTED] wrote in message 005901c16324$1cf252e0$0301a8c0@RED">news:005901c16324$1cf252e0$0301a8c0@RED... Can some one help fix this error? Warning: Variable passed to each() is not an array or object in /usr/local/.test.php on line 14 Here is the line: while(list ($key, $mid) = each ($HTTP_POST_VARS)) { -- Lic. Carlos A. Triana Torres. Webmaster. Centro de Informacion y Gestion Tecnologica Sancti Spiritus Email: [EMAIL PROTECTED] Tel: (53-41) 2 3956 http://www.magon.cu HamRadio: CO6TB Locator: FL01GW ICQ#: 137085816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: simple array tutorial wanted
http://www.onlamp.com/pub/a/php/2001/06/07/php_foundations.html Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, I really want to get me head around arrays, becuase I KNOW there's a better way to do some of the stuff i'm doing right now. I could mess with stuff for a few hours and probably get it, but i'd rather have a decent tutorial if anyone knows of one... Thanks, Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: File upload
Your files are being uploaded to the pre-defined temporary directory. $userfile contains the name of the temporary file the file was uploaded as. After you run all the checks on the file to make sure its valid, you should use copy() to move the file to its permament home in your file system, then use unlink() to remove the temporary file. http://www.php.net/manual/en/features.file-upload.php contains a whole bunch of information on the topic that may be useful -- Liz Fulghum -- http://www.lipstickalley.com/ - Be Popular! Want to learn PHP? http://webdeveloper.earthweb.com/scripting/article/0,,12014_900521,00.html -- Andrzej Roszkowski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! Where is file upload function? ;) From begining: some time I've found somewhere this handler: clearing_report_file is the input that is user sends to me. if(!isset($clearing_report_file)) { pp_xfer_trans(); } else { if (!@copy($clearing_report_file, $CFG[local_uri]./cfd- . $batch ..txt)) { echo(\nbSomething barfed, check the path to and the permissions for the upload directory/b); }else { // do domething exit(); } } but now, in php 4.0.5 this function don't want to work ;( i have allways something barfed message, even if i try to wrote to /tmp directory now i have this in phpinfo: HTTP_POST_FILES[userfile] Array ( [name] = helyjon [type] = [tmp_name] = none [size] = 0 ) where is my file? $variables shows the same values, where are my contents? Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better at it. - LJ Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: $ENV{'REMOTE_ADDR'}
if ($REMOTE_ADDR==127.0.0.1) { do something } elseif ($REMOTE_ADDR==remote.somewhere.com) { do something else } else { eeks! its the end } List of all the predefined variables: http://www.php.net/manual/en/language.variables.predefined.php -- Liz Fulghum -- http://www.lipstickalley.com/ - Be Popular! Want to learn PHP? http://webdeveloper.earthweb.com/scripting/article/0,,12014_900521,00.html -- Jtjohnston [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In perl I do something like this: if (!($ENV{'REMOTE_ADDR'} =~ /\b(132\.210)/)) or ... $ENV{'REMOTE_HOST'} PHP is not Perl. So how do I parse the user's remote address or host to display one thing if IP = 127.0.0.1, another if = 209.247.2.3 another if host = remote.somewhere.com else echo Blah; John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re[2]: [PHP] split array in 2 halfs
You could also grab the midpoint of the array: $count = round(count($array), 0); then populate your new arrays by using a foreach loop: $x = 0; foreach($array as $key = $value) { if ($x =$count) { $array1[] = $value; } else { $array2[] = $value; } $x++; } Daniel Harik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re[2]: [PHP] split array in 2 halfs
Correction: $count = count($array); $count = $count/2; $count = round($count,0); Liz Fulghum [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... You could also grab the midpoint of the array: $count = round(count($array), 0); then populate your new arrays by using a foreach loop: $x = 0; foreach($array as $key = $value) { if ($x =$count) { $array1[] = $value; } else { $array2[] = $value; } $x++; } Daniel Harik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]