My browser displays PHP code instead or runnning the program!

That’s because you’re not using a URL to connect to the PHP file. Most likely you are opening your HTML or PHP files by double-clicking them in Windows Explorer. When you do that, the HTML file looks fine but the PHP shows the actual code instead of running. And that’s because you are not using the Web server (even though you may have started the server). To connect to the server you can’t open the .html file in Windows Explorer, you must open the file as a URL in your browser so that the browser will then call the server.

You always know whether you are using the server by looking in the address window in your browser. If the address begins with http://localhost then you are using the server. If it begins with the word file:// followed by a drive letter and file path then you are not using the server..

So .. to do this correctly, don’t double click the file in Windows Explorer. Instead start your Web browser if it’s not already running and type the URL in the address window, for example:

http://localhost/Webtech/coursework/chapter05/modify1.html

If you get a Not Found message, that’s because you didn’t start your Web server first 🙂
Mike

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: