Jump to content
Larry Ullman's Book Forums

DougJ51

Members
  • Posts

    5
  • Joined

  • Last visited

DougJ51's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Hartely - I sent them the the information as you mentioned above and it worked OK for them too. I don't know why dreamweaver is keep stating I have syntax errors.
  2. Sorry guys - this is new to me and I just don't know why it won't work on my computer. Maybe I should try it on my Mac instead of my pc Thanks for everyone's patience and understanding. I appreciate your efforts to help me.
  3. I tried running it in WAMPP and received this error: Parse error: parse error in C:\wamp\www\predefined.php on line 15
  4. Hi HartelySan, Thank you for your reply. I think the problem has to do with why DreamWeaver is saying that the variable declarations have a syntax error. Does anyone know if in PHP you have to declare a Global before being able to use them? Something is wrong and I have a feeling it has to be something simple. Thanks, Doug
  5. Hi, My question is why won't this script run when I execute on the webserver where I have a dummy webpage setup. I created a website on Bluehost.com and I know it is setup correctly as I have run other php scripts on it for this book and for other books as well. When I am looking at the code below in DreamWeaver it tells me the lines with the variables have syntax problems and won't run. The code is copied exactly from the book so I'm stumped while I am getting the syntax errors. I've tried uploading the file to my webpage and it won't run there either so something is wrong. Will this file only execute if I am using Apache? Here is the code. The text colored red is where DreamWeaver says there are syntax errors. Thanks in advance for your help! <!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=utf-8" /> <title>Pre Defined Variables</title> </head> <body> <?php # Script 1.5 - predefined.php // 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>
×
×
  • Create New...