Jump to content

Echo Trouble


johne281

Recommended Posts

Hi. I have learned html and css and now i am learning php and mysql. I am following some video tutorials and he wants me to create a file called helloworld.php with the following code:

 

<html>

<head>

<title>Hello World</title>

</head>

<body>

<?php echo "Hello World!"; ?>

</body>

</html>

 

I have done that and when i view the file in a browser it is a blank document named Hello World. I have done this part before and it worked fine. What am i doing wrong now? Please help. This is so frustrating. Im sure it is just me overlooking something minor. Any help would be appreciated.

Link to comment
Share on other sites

If it's worked before you must have a local server and php set up and in place. Are you accessing the file via the server?

 

If you just double click the .php file it will open from its 'Computer Directory' C:/ etc...

 

You need to ensure its accessed via a browser with the correct protocol, most likely http://localhost/ to access the root of your server

Link to comment
Share on other sites

Hey guys I just restarted WAMP and it is working fine now. For a minute there it wouldnt even display my phpinfo file. Thats when I restarted. What would cause problems like this? Thanks so much for all your help so far. You will be seeing more from me I'm sure.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.