Stuck on Tutorial
am 27.11.2007 09:49:56 von Wings
According to a tutorial, the five lines at the bottom are all that's
needed to cause a file named testFile.txt to be created. I put those 5
lines in a page called study.php, uploaded it to my server, and changed
all the permissions to 777. (And later experimented with some others).
The result is always this error:
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or
'$' in /home/nyghtwyn/public_html/study/study.php on line 3
Stymied at this point. Any help will be appreciated.
$ourFileName = "testFile.txt";
$ourFileHandle = fopen($0urFileName, 'W') or die("can't open file");
fclose($ourFileHandle);
?>
Re: Stuck on Tutorial
am 27.11.2007 12:44:25 von Janwillem Borleffs
Wyngs schreef:
>
> $ourFileName = "testFile.txt";
> $ourFileHandle = fopen($0urFileName, 'W') or die("can't open file");
> fclose($ourFileHandle);
> ?>
Notice the difference between '$ourFileName' and '$0urFileName'.
Variable names are case-sensitive in PHP. Tip: increase your error level
to E_ALL (either in your php.ini file or through the error_reporting
function).
JW
Re: Stuck on Tutorial
am 27.11.2007 12:45:20 von Jerry Stuckle
Wyngs wrote:
> According to a tutorial, the five lines at the bottom are all that's
> needed to cause a file named testFile.txt to be created. I put those 5
> lines in a page called study.php, uploaded it to my server, and changed
> all the permissions to 777. (And later experimented with some others).
> The result is always this error:
>
> Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or
> '$' in /home/nyghtwyn/public_html/study/study.php on line 3
>
> Stymied at this point. Any help will be appreciated.
>
>
>
>
> $ourFileName = "testFile.txt";
> $ourFileHandle = fopen($0urFileName, 'W') or die("can't open file");
> fclose($ourFileHandle);
> ?>
>
$ourFileName is NOT $0urFileName.
Also, 'W' needs to be 'w'.
PHP is case sensitive in variable names, and fopen()'s second parameter
is case sensitive.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Stuck on Tutorial
am 28.11.2007 04:34:15 von Wings
Janwillem Borleffs wrote:
> Wyngs schreef:
>
> >
> > $ourFileName = "testFile.txt";
> > $ourFileHandle = fopen($0urFileName, 'W') or die("can't open file");
> > fclose($ourFileHandle);
> > ?>
>
> Notice the difference between '$ourFileName' and '$0urFileName'.
>
> Variable names are case-sensitive in PHP. Tip: increase your error level
> to E_ALL (either in your php.ini file or through the error_reporting
> function).
>
>
> JW
Dang me! I went over this a dozen times to make sure I wasn't posting a
typo here, and I did anyhow. Many thanks.
I still haven't checked to see if I have access to php.ini with my host,
but I've made a note here to do so.
Re: Stuck on Tutorial
am 28.11.2007 04:36:09 von Wings
Jerry Stuckle wrote:
> Wyngs wrote:
> > According to a tutorial, the five lines at the bottom are all that's
> > needed to cause a file named testFile.txt to be created. I put those 5
> > lines in a page called study.php, uploaded it to my server, and changed
> > all the permissions to 777. (And later experimented with some others).
> > The result is always this error:
> >
> > Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or
> > '$' in /home/nyghtwyn/public_html/study/study.php on line 3
> >
> > Stymied at this point. Any help will be appreciated.
> >
> >
> >
> >
> > $ourFileName = "testFile.txt";
> > $ourFileHandle = fopen($0urFileName, 'W') or die("can't open file");
> > fclose($ourFileHandle);
> > ?>
> >
>
> $ourFileName is NOT $0urFileName.
>
> Also, 'W' needs to be 'w'.
>
> PHP is case sensitive in variable names, and fopen()'s second parameter
> is case sensitive.
>
>
Thanks, Jerry. Now I can get moving again...