johne281 Posted June 30, 2009 Share Posted June 30, 2009 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. Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted June 30, 2009 Share Posted June 30, 2009 I just copied and pasted and it worked fine. Is it possible that it's saved as a .html or .htm instead of .php. If it is then it may be that your web server is not setup to parse php in html files. Quote Link to comment Share on other sites More sharing options...
johne281 Posted June 30, 2009 Author Share Posted June 30, 2009 Hmmm. I am using wamp locally and it is saved as .php. Where can I check to make sure my server is set up correct? Thanks so much for your help Quote Link to comment Share on other sites More sharing options...
gevans Posted June 30, 2009 Share Posted June 30, 2009 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 Quote Link to comment Share on other sites More sharing options...
johne281 Posted June 30, 2009 Author Share Posted June 30, 2009 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.