Re: Intro to PHP question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am not a linux expert but it might be because instead of running it like

php myprogram.php

you are just typing

myprogram.php

in which case, the file needs to have a comment in the first line telling the shell which interpreter should handle it. Some

#!php

or something like that, not sure.

Anyway, it is just the guess of a non-expert.

Satyam

----- Original Message ----- From: "Jonathan Kahan" <jonathan@xxxxxxxxxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Cc: "Jonathan Kahan" <jonathan@xxxxxxxxxxxxxx>
Sent: Thursday, March 08, 2007 5:43 PM
Subject:  Intro to PHP question


Hi all,

I am using a linux server. When the php file below (uri.php) is run from the command line I get the following error. Any ideas on what I could do differently?

Thanks for any help,

Jonathan

../uri.php: line 1: syntax error near unexpected token `newline'
../uri.php: line 1: `<html>'

<html>
<body><?php
$d=date("D");
if ($d=="Fri")
 echo "Have a nice weekend!";
else
 echo "Have a nice day!";
?></body>
</html>


Kind Regards
Jonathan Kahan
--------------------------------------------------------------------
Systems Developer
Estrin Technologies, inc.
1375 Broadway, 3rd Floor, New York, NY, 10018
--------------------------------------------------------------------
Email: jonathan@xxxxxxxxxxxxxx
Web: http://www.estrintech.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.7/713 - Release Date: 07/03/2007 9:24



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux