Jump to content

Where did I go wrong


Virtual-Instructor

Recommended Posts

Ok I am officially frustrated :bash: . 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.

Link to comment
Share on other sites

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 by Archadian
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...