php

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

php

Postposted on Wed May 27, 2009 9:06 am

I am "getting started" with php. I am trying to echo the output of a function. I have not gotten it to work yet. Here is how I am going about it:

Code: Select all
<html><body>
<?php echo "testing echo output" ?> //this works and shows up in the browser

<?php
$currdir = dirname($SERVER['PHP_SELF']);
echo $currdir;  //this does not work.
?>

</body></html>


So, who can tell the noob why he is failing?
flip-mode
Gerbil Khan
Silver subscriber
 
 
Posts: 9084
Joined: Thu May 08, 2003 12:42 pm
Location: Cincinnati, OH

Re: php

Postposted on Wed May 27, 2009 9:09 am

Aw crap, I figured it out. $SERVER should be $_SERVER.

It's all about the details.
flip-mode
Gerbil Khan
Silver subscriber
 
 
Posts: 9084
Joined: Thu May 08, 2003 12:42 pm
Location: Cincinnati, OH


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 3 guests