Jump to content

Where do I save php files in WAMP?


Lee

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.
Link to comment
https://forums.phpfreaks.com/topic/21419-where-do-i-save-php-files-in-wamp/
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
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 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

Archived

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

×
×
  • Create New...

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.