2 Replies - 134 Views - Last Post: 14 September 2013 - 08:22 AM Rate Topic: -----

#1 Java Student  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 480
  • Joined: 05-February 10

PHP not working locally

Posted 14 September 2013 - 07:14 AM

I'm relatively new to setting up servers locally just to work with PHP files.

I ran WAMPSERVER and let it sit in my process(there was no GUI pop up, normal?).

I tried running the most basic script on this tutorial page http://html.net/tuto...hp/lesson11.php

.html
	<html>
	<head>
	<title>Form</title>
	</head>
	<body>

	<h1>Enter your name</h1>

	<form method="post" action="handler.php">
	<input type="text" name="username">
	<input type="submit">
	</form>

	</body>
	</html>




.php
        <html>
	<head>
	<title>Form</title>
	</head>

	<body>

	<?php

	echo "<h1>Hello " . $_POST["username"] . "</h1>";

	?>

	</body>
	</html>
	



I enter some text in the box, click the button, then i get the resulting text on IE:
Hello " . $_POST["username"] . ""; ?> 



And i'm pretty sure I ran it from the appropriate directory:
C:\wamp\www\website2\handler.php

Is This A Good Question/Topic? 0
  • +

Replies To: PHP not working locally

#2 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2834
  • View blog
  • Posts: 9,740
  • Joined: 08-August 08

Re: PHP not working locally

Posted 14 September 2013 - 07:16 AM

There is no C drive in a URL. URLs look like this:
http://handler.php

This post has been edited by CTphpnwb: 14 September 2013 - 07:17 AM

Was This Post Helpful? 0
  • +
  • -

#3 Java Student  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 480
  • Joined: 05-February 10

Re: PHP not working locally

Posted 14 September 2013 - 08:22 AM

Ahh yes. Works now, thanks CT!

http://localhost/website2/handler.php
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1