Re: Intro to PHP question

From: Date: Thu, 08 Mar 2007 19:32:22 +0000
Subject: Re: Intro to PHP question
References: 1 2 3 4 5 6 7 8 9  Groups: php.general 
Request: Send a blank email to php-general+get-250115@lists.php.net to get a copy of this message
Sorry, I didn't even think about that. I use many php files as "shell" scripts... and u need this for any interpreter your using if you want to execute the file directly from the command line, otherwise you would have to type php scriptname.php from the command line. ----- Original Message ----- From: "Jonathan Kahan" <jonathan@estrintech.com> To: <php-general@lists.php.net> Sent: Thursday, March 08, 2007 1:43 PM Subject: Re: [PHP] Intro to PHP question Hi all, I went to a website called php-cli.com and found that i needed to type #!/usr/bin/php -q in the header line. Once I typed that, my script without the HTML tags executed. Thanks again, Jonathan ----- Original Message ----- From: Tijnema ! To: Jonathan Kahan Cc: Dave Goodchild ; php-general@lists.php.net Sent: Thursday, March 08, 2007 12:54 PM Subject: Re: [PHP] Intro to PHP question AFAIK you can't run a php file directly, or you need to add #!/bin/php or something to the first line, but you can run it with php ../uri.php but i suggest you to run it from a webserver like apache. *if you don't have it, i can give you a few MB to try PHP out Tijnema On 3/8/07, Jonathan Kahan <jonathan@estrintech.com> wrote: Hi all, Dave, I am attempting to use html for learning purposes. My goal is to begin working on a website. Tijnema, I tried the below and got the following errors. I can't imagine the error on line 3 is a tag issue. Jonathan [root@ip-XXX-XXX-XX-XXX cgi-bin]# ./uri.php ./uri.php: line 2: ?php: No such file or directory ./uri.php: line 3: syntax error near unexpected token `"D"' ./uri.php: line 3: `$d=date("D");' [root@ip-XXX-XXX-XX-XXX cgi-bin]# vi uri.php [root@ip-XXX-XXX-XX-XXX cgi-bin]# vi uri.php <?php $d=date("D"); if ($d=="Fri")
     echo "Have a nice weekend!";
else
     echo "Have a nice day!";
?>
     ----- Original Message -----      From: Dave Goodchild
     To: Tijnema !
     Cc: Jonathan Kahan ; php-general@lists.php.net
     Sent: Thursday, March 08, 2007 12:43 PM
     Subject: Re: [PHP] Intro to PHP question
     If you are running that from the command line, why do you need html? Not sure why you're doing that.


« previous php.general (#250115) next »