CGI app
| From: | Liz Kimber | Date: | Wed, 24 May 2000 17:11:58 +0000 |
| Subject: | CGI app | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-442@lists.php.net to get a copy of this message | ||
So far I only have experience with making embeded PHP in HTML, so I have a
stupid (probably question)
I've made a script, it looks like this
#!/usr/local/bin/php -q
$counterfile = '/path/counter';
if (file_exists ($counterfile) == true )
{
while (( $fp = fopen ($counterfile,"r+")) == false)
{ usleep(5);}
while (!flock($fp,2))
{ usleep(5); }
$data = fread($fp,filesize($counterfile));
$content=explode(" ",$data);
$content[1]=$content[1]+1;
if (rewind($fp)!=0)
{
$data=implode(" ",$content);
fwrite($fp,$data,strlen($data));
}
flock($fp,3);
fclose($fp);
}
header("Content-type: application/octet-stream");
$t=readfile("/somewhere/setup.exe");
So, why when I run it doing php myfile.php does it work but when apache
calls it it does squat and says "No input file specified"?
Am I dumb?