I'm running WAMP , PHP 5.3.0, MYSQL 5.1.36 and APACHE 2.2.11
The first excercise using today.php worked fine. I type into my browser -> http://localhost/today.php and I get the desired result i.e. date shows up. But for the welcome1.html , which is in my the C:\WAMP\ directory just like 'today.php', I type into my browser http://localhost/welcome1.html and it returns with a 404 error, page not found. Since the stuff I typed in wasn't working I am using exact copies of what's in your code archive.
Not sure what I'm doing wrong?
I can go through explorer and click on the html file and it works, kinda, but when I click on the link (Hi my name is kevin) it just brings me to a "file///c:/wamp/welcome1.php..." . From reading other customers' issues on this I realize you can't click on the link from explorer.
Help please? thanks, emagify
Is the file extension actually .htm, rather than .html?
The mark-up for the HTML page is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>Query String Link Example</title>
<p><a href="welcome1.php?name=Kevin">Hi, I’m Kevin!</a></p>
The link is a "relative" link (as opposed to "absolute" like your type into the address bar).
Because its a relative link and you're going to it through your OS it looks for it as a "file" instead of "http".
Because you're getting
I'm guessing you put the file directly under the WAMP app folder instead of under the htdocs folder.
When you sart up the server and go to a localhost HTTP address, it does NOT look in the main WAMP app folder, but goes directly to the htdocs folder.
I put both files (welcome1.php and welcome1.html; the html file calls the php file) in the htdocs folder (wamp/bin/apache/apache2.2.11/htdocs). Then I tried to run it by typing http://localhost/welcome1.html . It still gives me the 404 file not found error.
Is that the right htdocs folder?
Not sure what you mean by "Because its a relative link and you're going to it through your OS it looks for it as a "file" instead of "http"."
Appreciate your attempts to help me. mark
Sorry for the slower response, lost the momentum of helpers. Any ideas to help me
Relative links will work in a web page with Windows explorer and IE.
eg. if you put these on your computer in any folder anywhere and click on them to open.
<a href='page2.html'>page 2</a>
<a href='page1.html'>page 1</a>
But absolute links with the "http" need to go to a server.
AFAIK that should be the right "htdocs" folder (there should be only one),
Maybe you need to use a port? But as the PHP file is OK I doubt that.
Try starting the server and pointing your browser to
And double check spelling and case. Welcome is not the same as welcome
Thanks for the help. Spelling was correct. I put them in the www folder under wamp and it worked fine.
Just don't know why under www it worked but not under the main wamp or under htdocs?
This topic is now closed. New replies are no longer allowed.