Jump to content

Archived

This topic is now archived and is closed to further replies.

Lee

Where do I save php files in WAMP?

Recommended Posts

Hi everyone I'm also brand new to php  :-\

I have just installed WAMP5, used localhost during install, & localhost is showing all the right info.

I'm learning from the 'php for dummies' book & made a php file with the following code..
[code]<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<?php
echo “<p>This is a PHP line</p>”;
phpinfo();
?>
</body>
</html>[/code]

I know this is info is already available from localhost, but where would I store this file to make it work?

Thanks.

Share this post


Link to post
Share on other sites
Look for the WAMP installation directry which I think is located in the root of the hard drive - C:\WAMP - look for a folder called [b]htdocs[/b] or [b]www[/b] within the WAMP folder. You put all your php files in the htdocs or www folder. You can then access these php files by going to http://localhost/filename.php

Share this post


Link to post
Share on other sites
aahh I see, I was just going to the www directory & opening the file. I didn't realise I would need to use http://localhost/ in the browser.
I assume I will do this with every file I create now then..

Thanks mate!! ;D

Share this post


Link to post
Share on other sites
Yeah that is correct. PHP runs on the server, thus you had to instal WAMP. You cannot run php files like you can when you double click a html files and it opens up in IE. PHP is not a lanaguage the browser understands, as PHP is a web programming langauge. HTML, CSS and javascript are client side lanagugaes which the browser understands. PHP generates the output which will be mainly text/HTML from your code.

Share this post


Link to post
Share on other sites
[quote author=wildteen88 link=topic=108798.msg438059#msg438059 date=1158766677]
Yeah that is correct. PHP runs on the server, thus you had to instal WAMP. You cannot run php files like you can when you double click a html files and it opens up in IE. PHP is not a lanaguage the browser understands, as PHP is a web programming langauge. HTML, CSS and javascript are client side lanagugaes which the browser understands. PHP generates the output which will be mainly text/HTML from your code.
[/quote]

Aha, thats another penny that has now just dropped! Thanks again  ;D

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.