PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > Stuck on Tutorial
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Stuck on Tutorial

Réponse
 
LinkBack Outils de la discussion
Vieux 27/11/2007, 08h49   #1
Wyngs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Stuck on Tutorial

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 will be appreciated.



<?php
$ourFileName = "testFile.txt";
$ourFileHandle = fopen($0urFileName, 'W') or die("can't open file");
fclose($ourFileHandle);
?>
  Réponse avec citation
Vieux 27/11/2007, 11h44   #2
Janwillem Borleffs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Stuck on Tutorial

Wyngs schreef:

> <?php
> $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
  Réponse avec citation
Vieux 27/11/2007, 11h45   #3
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Stuck on Tutorial

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 will be appreciated.
>
>
>
> <?php
> $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
==================

  Réponse avec citation
Vieux 28/11/2007, 03h34   #4
Wyngs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Stuck on Tutorial

Janwillem Borleffs wrote:

> Wyngs schreef:
>
> > <?php
> > $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.
  Réponse avec citation
Vieux 28/11/2007, 03h36   #5
Wyngs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Stuck on Tutorial

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 will be appreciated.
> >
> >
> >
> > <?php
> > $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...

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h54.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13563 seconds with 13 queries