Re: Beginning php study
- From: "Wings" <glenn61@xxxxxxxxxxxxx>
- Date: Sat, 18 Jun 2005 18:24:18 GMT
"Wings" <glenn61@xxxxxxxxxxxxx> wrote in message
news:EtZse.5728$hK3.2196@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> "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.
>
As a final note here, I retyped all the lines, with the spaces in $age = 67.
With your correction and the retyping, it now works. I have a propensity to
hit two keys sometimes when I'm headed for one and I think I inserted some
kind of invisible character in there.
Thanks again. Now we can get on with this...
.
- References:
- Beginning php study
- From: Wings
- Re: Beginning php study
- From: Ken Robinson
- Re: Beginning php study
- From: Wings
- Beginning php study
- Prev by Date: Re: Beginning php study
- Next by Date: anybody interested in making money through PHP/MySQL and flash
- Previous by thread: Re: Beginning php study
- Next by thread: anybody interested in making money through PHP/MySQL and flash
- Index(es):
Relevant Pages
|