[thelist] quick PHP question

Joe Crawford jcrawford at avencom.com
Thu May 3 13:44:04 CDT 2001


Erik Mattheis wrote:
> I know nothing about PHP. I need to install a mail form for a client
> ... the server has PHP, and am I correct that the whole directory
> should be set to the same permission for php to work

If you're getting a "parse error" then it's already working.

The error is a syntax error.

>- and therefore
> I won't have to change permissions on any files for stuff they have
> me do in the future? Their hosting company has to change permission
> (despite the fact that this is a co-located server!) ... what should
> I tell them to set permissions to ... and the whole directory? - is
> this error due to incorrect permissions?

No, just syntax.

> <?php
> phpinfo()
> php?>

> Parse error: parse error in /var/www/linksol/htdocs/test.php on line 12
> line 12 is last line of of code posted.

Should be:

<?php
phpinfo()
?>

if you have more than one line, each line needs to end with a semicolon,
note. My habit is to include them even if optional.

<?php
phpinfo();
?>

Also, some servers (most?) allow you to invoke php with a plain ol':
<? phpinfo(); ?>

And even others allow you to use ASP style like syntax:

<% phpinfo(); %>

You should get yerself over to http://php.net/ - nice intro to the
syntax rules and where to get started.

HTH,
	Joe
--
Joe Crawford ||||||||||||||       mailto:jcrawford at avencom.com
||||||||||||||||||||||||             http://www.avencom.com
|||||||||||||||||||||||||||      Avencom: Set Your Sites Higher




More information about the thelist mailing list