0

My index.html is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title></title>
</head>

<body>
<form action="index.php" method="post" name="uandp">
<input type="text" name="user"><br >
<input type="password" name="password">
<input type="submit" value="Go">
</form>
</body>
</html>

My index.php is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php session_start(); ?>

<html>
<head>
	<title></title>
</head>

<body>
<?php
print "Printeo";
echo 'Llego!';
$uservar=_$POST['user'];
echo $uservar;
?>
</body>
</html>

The when I click the button in the html in the form, it goes to the php page but displays the code. When I hit F5, it says it has to send data again to the server and doesnt show any information at all.


Problably something dumb and basic Im missing. I know it works because I put it in my htdocs folder which is by default. PHP also works.

Thanks

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by riahc3
0

Well, _$POST should be $_POST. But that should not display your code. Are you absolutely sure PHP works ?

If you make a file call phpinfo.php with this in it:

<?php
  phpinfo();
?>

What does it show ?

0

I made it and basically same thing happens: Code is shown.

PHP works as I can access phpMyAdmin perfectly. Also if I go to http://localhost/ ir redirects me to http://localhost/xampp/.Localhost by default is at C:\xampp\htdocs\ I made a folder in there with the html and php files.

Edited by riahc3: n/a

0

I officially believe I am a idiot.....

I was navigating to C: instead of http:// in my browser....

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.