Re: Beginning php study





Wings wrote:
> Hi, just beginning my study of php and got stuck right off the bat. I saved
> the following to a page called test.php.
>
> <? php
> $age = 67;
> echo $age;
> ?>
>
> Looking at it in the browser I get
>
> Parse error: syntax error, unexpected T_VARIABLE in
> C:\XAMPP\xampplite\htdocs\nitefly\FCU\FCU\test.php on line 6
>
> Line 6 was the $age=67.

PHP often reports an error where it gives up trying to parse something,
not where the error really is.

In your case, you have a space where no space should be. You have '<?
php', it should be '<?php' or if short tags are enabled, just '<?'.

Ken

.



Relevant Pages

  • Re: PHP/MYSQL Parse Error
    ... Here is the code to enter it into the database: ... have to take your socks off to do it - and discover that php is ... undefined constant localhost and that 'localhost' has been assumed. ... thing PHP said was that there was a parse error on line 20. ...
    (comp.lang.php)
  • Re: exec() has a syntax error, need an index.php page, cURL script
    ... No. once you exec to the servers OS, waht you send will depend on the ... the php is 'talking' to the browser at the client end. ... A missing file will not create a parse error. ... Fix your syntax error. ...
    (comp.lang.php)
  • Re: exec() has a syntax error, need an index.php page, cURL script
    ... No. once you exec to the servers OS, waht you send will depend on the ... the php is 'talking' to the browser at the client end. ... A missing file will not create a parse error. ...
    (comp.lang.php)
  • Re: [PHP] Blank page of hell..what to look for
    ... Turn on error reporting from apache using the httpd.conf file, in your php.ini file, or with a .htaccess file. ... "Some men are born to greatness, some achieve greatness, ... PHP General Mailing List ... Yes I have not had a single parse error in any of my files since I ...
    (php.general)
  • Beginning php study
    ... just beginning my study of php and got stuck right off the bat. ... Parse error: ...
    (php.general)