judgedredd Posted May 21, 2011 Share Posted May 21, 2011 Hi, I have been going through the lessons/examples but am stumped on the first dynamic script on page 36 (script 1.5) Here is what I wrote: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content= "text/html; charset=iso-8859-1" /> <title>Predefined variables</title> </head> <body> <?php # script 1.5 predefined.php # May 21 2011 // Create a shorthand version of the variable names: $file = $_SERVER[‘SCRIPT_FILENAME’]; $user = $_SERVER[‘HTTP_USER_AGENT’]; $server = $_SERVER[‘SERVER_SOFTWARE’]; // Print the name of this script: echo "<p>You are running the file:<br /><b>$file</b></p>\n"; // Print the user’s information: echo "<p>You are viewing this page using:<br /><b>$user</b></p>\n"; // Print the server’s information: echo "<p>This server is running:<br /><b>$server</b>.</p>\n"; ?> </body> </html> And I get nothing. The page is here: http://matrixfiles.com/lu/predefined.php On my computer webserver (Wamp) I get this page (screenprint): This has completely puzzled me. Anyone know what I am doing wrong? I have double checked the code and nothing seems to be out of place. Link to comment Share on other sites More sharing options...
Jonathon Posted May 21, 2011 Share Posted May 21, 2011 I just copied your code to my editor and your single quotes were'nt actually single quotes. Once i replaced your quotes that seemed to be in between a back tick ` and a single quote ' it worked fine. 1 Link to comment Share on other sites More sharing options...
judgedredd Posted May 21, 2011 Author Share Posted May 21, 2011 Hi Jonathon, Blimey! It looked ok to me but when looking closer it did look a bit wierd. Correcting those quote marks did the trick. Thanks for taking the time to look at this. Link to comment Share on other sites More sharing options...
Recommended Posts