Virtual-Instructor Posted June 28, 2011 Report Share Posted June 28, 2011 Ok I am officially frustrated . For the last three days I have been stuck on Video 7 of the Basics of PHP. I was able to follow the video and understand everything that was being said. Unfortunately I have not been able to duplicate the results in the video with the results on my local machine. I will start by posting the code that I hand typed using MS Notepad. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv'"Content-Type" content="text/html; charset=iso-8859-1"> <title>Boston Virtual ATC Share the Cockpit</title> </head> <body> <?php print "Hello World."; print "I am learning this so that these first steps become the future of the STC Web Site."; ?> </body> </html> Ok in the video Steph stops and talks about projects that you see on the local host page. I have been trying to get the strings to display on the page, but all I get is either a display of the txt doc or a blank white page. I know that I am close because the meta data appears on the browser tab, however I am not actually able to get the thing to display. Now I did notice in the video that Steph never discusses how to save the txt document so that it will display as a web page and he is also using Dreamweaver. So far I have tried saving the document as a txt format, which returns the txt display, when I save the document as an html, all I get is a blank page. What am I missing here. I would like to move on past video 7 and continue on but I'm not willing to do so until I can get the same results on my computer that the video is displaying. Any help here is appriciated. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted June 28, 2011 Report Share Posted June 28, 2011 You need to save it as a .php file, so the server understands that it contains PHP code, and make sure you place the files (I'm assuming you are using WAMP?) within c:/wamp/www so the server can access the files. And obviously WAMP needs to be running. Quote Link to comment Share on other sites More sharing options...
Archadian28 Posted June 29, 2011 Report Share Posted June 29, 2011 (edited) Try <?php echo "Hello World."; echo "I am learning this so that these first steps become the future of the STC Web Site."; ?> print() and print_r() is mainly for printing out arrays. the r in print_r() prints the array out in a readable format. Edited June 29, 2011 by Archadian Quote Link to comment Share on other sites More sharing options...
Virtual-Instructor Posted June 29, 2011 Author Report Share Posted June 29, 2011 You need to save it as a .php file, so the server understands that it contains PHP code, and make sure you place the files (I'm assuming you are using WAMP?) within c:/wamp/www so the server can access the files. And obviously WAMP needs to be running. As usual Ben you are an endless wealth of knowledge. Thanks for the clarification. Quote Link to comment Share on other sites More sharing options...
Virtual-Instructor Posted June 29, 2011 Author Report Share Posted June 29, 2011 (edited) It Works! . Ok now this very cool. On to the next video. Edited June 29, 2011 by Virtual-Instructor 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.
Note: Your post will require moderator approval before it will be visible.