Page 1 of 1

Problens with GET

Posted: Sun Apr 13, 2003 10:15 am
by molandim
Hi everyone. I am novice in Php. I installed easyphp in my computer, for see my php pages. So i try pass information to one page to another with GET..

Didn´t work...

I do now why, Maybe wrong code or the apache form this software is broken, i do know...

Look my code
send.html

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

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

<body>
<form action="http://localhost/script.php" method="get">
<input type="text" name="nome" size="5">
<input type="submit" name="submit">

</form>


</body>
</html>
Page that take this information

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

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

<body>
Go 
<?php 
$oi = $_POST&#1111;'nome'];
Echo "$oi";
  ?>

</body>
</html>
I see on the url that the information is there, but the php only show GO and don´t show the variable $oi..

WHY???? :( :( :(

Posted: Sun Apr 13, 2003 11:09 am
by SlyckRay
Greetings.

When using method="get" you must use $_GET not $_POST. i recommend you use method="post" and leave the $_POST variable so that info like a users name isn't pasted to the link.


Ray