note 93598 added to function.popen

From: Date: Thu, 17 Sep 2009 18:56:44 +0000
Subject: note 93598 added to function.popen
Groups: php.notes 
Request: Send a blank email to php-notes+get-160803@lists.php.net to get a copy of this message
To run a php script and not wait for it I use this on windows $commandString = "start /b c:\\php\\php.EXE c:\\image\\cleanup.php --passaccount=$account --passcount=$count"; pclose(popen($commandString, 'r')); Note to pass my script vars you need dashdash. to read the var use --this is in cleanup.php function arguments($argv) { $_ARG = array(); foreach ($argv as $arg) { if (ereg('--[a-zA-Z0-9]*=.*',$arg)) { $str = split("=",$arg); $arg = ''; $key = ereg_replace("--",'',$str[0]); for ( $i = 1; $i < count($str); $i++ ) { $arg .= $str[$i]; } $_ARG[$key] = $arg; } elseif(ereg('-[a-zA-Z0-9]',$arg)) { $arg = ereg_replace("-",'',$arg); $_ARG[$arg] = 'true'; } } return $_ARG; } sleep(5); $var_array= arguments($argv); extract($var_array, EXTR_PREFIX_SAME, "wddx");//$user comes from here //echo "hello new $user"; $account=$passaccount; $count=$passcount; ---- Server IP: 209.41.74.194 Probable Submitter: 69.37.214.5 ---- Manual Page -- http://www.php.net/manual/en/function.popen.php Edit -- https://master.php.net/note/edit/93598 Del: integrated -- https://master.php.net/note/delete/93598/integrated Del: useless -- https://master.php.net/note/delete/93598/useless Del: bad code -- https://master.php.net/note/delete/93598/bad+code Del: spam -- https://master.php.net/note/delete/93598/spam Del: non-english -- https://master.php.net/note/delete/93598/non-english Del: in docs -- https://master.php.net/note/delete/93598/in+docs Del: other reasons-- https://master.php.net/note/delete/93598 Reject -- https://master.php.net/note/reject/93598 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#160803) next »