Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

_FILE_ and _LINE_ question 1

Status
Not open for further replies.

Thadeus

Technical User
Joined
Jan 16, 2002
Messages
1,548
Location
US
I am an extreme newbie at PHP and walking my walk through an e-book... On one example/lesson they have us request the _FILE_ variable contents to be 'echoed'. Additional lines request the PHP_VERSION and PHP_OS values as well.

Here's the question: Why do the version and OS values pop, but the word _FILE_ appears instead of the File name? Since this is such a simple script I can see that the syntax is the same across each line of code... simply:

<?
echo &quot;<br>here is my file &quot;._FILE_;
echo &quot;<br>here is the OS &quot;.PHP_OS;
//etc...
?>

OUTPUT is similar to:

here is my file _FILE_
here is the OS PHP4.3.3


Same problem with _LINE_ variable
Thanks,
Thadeus
 
I think you'll find that the two constants are not
Code:
&quot;_FILE_&quot;   and &quot;_LINE_&quot;,
but rather
Code:
&quot;__FILE__&quot; and &quot;__LINE__&quot;

(two underscores before and after)


Want the best answers? Ask the best questions: TANSTAAFL!!
 
Thank you, I'll play with that this evening. Funny thing is I believe I even copy and pasted from the e-book trying to make this work.

That would make the second code typo I've run into in this e-book... I'll have to keep my eyes open.

Thanks again,
Thadeus
 
I tested the other day with the double underscore and it worked perfectly. Thanks for your quick and accurate reply.

Thadeus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top