Page 1 of 1

Unable to receive value from text box to other form!!!!

Posted: Wed Mar 14, 2007 2:04 am
by ikhalid
I have recently started using Xampp for PHP coding.....The problem iam facing is that, i create an HTML form and write tag for it such as "<input type=text name= "textbox">"....when i go to second form and write "echo $textbox"....i don't see any output value that i had entered in the text box on first form.
I have turned Register Globals=On.....$_GET is also not working
I am an old user of IIS server but this the first time iam having such kind of problem, may be coz of Xampp....i am not 2 good with Apache.

Much appreciated f someone helps me out.
Thanx

Posted: Wed Mar 14, 2007 3:42 am
by louie35
first see what method you are using.

Code: Select all

//if form is set as post

$textbox = $_POST['textbox'];

//or get

$textbox = $_GET['textbox'];

echo $textbox;
also make sure the form submits to the page where you request the form fields.

Posted: Wed Mar 14, 2007 3:44 am
by volka
please try

Code: Select all

<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
?>
<html>
	<head>
		<title>http parameter test</title>
	</head>
	<body>
		<pre><?php var_export($_POST); ?></pre>
		<form method="post" action="#">
			<div>
				<input type="text" name="textbox" />
				<br />
				<input type="submit" />
			</div>
		</form>
	</body>
</html>

Posted: Wed Mar 14, 2007 4:00 am
by mentor