Re: Beginning php study




"Ken Robinson" <kenrbnsn@xxxxxxxxx> wrote in message
news:1119087654.704106.15530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
>
> 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
>
Many thanks, Ken. I took that space out. It didn't help, but I was glad to
have that pointed out to me. Then I noticed that I had spaces in the line
$age = 67. I took those out and now the program works. This is actually
annoying as the text I'm using clearly shows those spaces in there.


.



Relevant Pages

  • Re: use SESSION variable?
    ... If ever a newbie wants to know how much he has to learn yet, ... PHP 5.2.5; XP Pro SP2+, ... I want to 'input' "age" in 1.php, ... Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. ...
    (comp.lang.php)
  • use SESSION variable?
    ... PHP 5.2.5; XP Pro SP2+, ... How do I get a POST variable into a session ... I want to 'input' "age" in 1.php, ... Warning: Unknown: Your script possibly relies on a session side-effect ...
    (comp.lang.php)
  • Re: Dynamic Radio Buttons
    ... I execute a while loop that displays a group of questions the ... Any way to use PHP to accomplish my goal? ... Age[] and that IS the group as far as HTML is concerned. ... they are automagically turned into an array: ...
    (comp.lang.php)
  • Re: Dynamic Radio Buttons
    ... I execute a while loop that displays a group of questions the ... Any way to use PHP to accomplish my goal? ... Age[] and that IS the group as far as HTML is concerned. ... they are automagically turned into an array: ...
    (comp.lang.php)
  • Re: Dynamic Radio Buttons
    ... catch the user's input and write it to a database: ... Any way to use PHP to accomplish my goal? ... Age[] and that IS the group as far as HTML is concerned. ... they are automagically turned into an array: ...
    (comp.lang.php)