Help: a problem with $_POST & $_GET[]
Posted: Fri Mar 18, 2011 5:20 pm
Hi
..iam an IT student so i'm trying to develop my skills in php
i have a problem with $_POST[] & $_GET[] the both don't work when submitting the form for example :
this is the HTML Code :
and in the index.php this is the code :
1-i'm using PHP 5.3.5 and Server version: Apache/2.2.17 (Unix)
2-in the php.ini i modified the register_globals and put the value: On -but no result.
3- and after 3 hours of searching without any reasult : i modified the register_long_arrays to : On -even it don't solve my problem
and post_max_size already = 8M
4- i checked the variables_order and yes it has the value of : "GPCS" and about the request_order it has the value "GP".
5-some people on the web was talking about mod_bandwidth i didn't find it in the httpd.conf !!they said it should be disabled or or or ..etc..
after 5 hours i used another code to test it
i quoted it from a book this is the code -it didn't work too
all what i got from both codes were blank page ...
thank you all
[/size]
i have a problem with $_POST[] & $_GET[] the both don't work when submitting the form for example :
this is the HTML Code :
Code: Select all
<html>
<head>
<title>Test</title>
</head>
<body>
<form method="post" action="index.php">
<fieldset>
<legend>Enter Date</legend>
First Name:<input type="Text" name="FirstName"/><br/>
Last Name:<input type="Text" name="LastName"/><br/>
<input type="submit" value="Submit"/>
</fieldset>
</form>
</body>
</html>and in the index.php this is the code :
Code: Select all
<?php
$Fname=$_POST['FirstName'];
$LName=$_POST['LastName'];
$FullName=$Fname.' '.$LName;
echo $FullName;
/* i used before the one above the following code :
echo $_POST['FirstName'].' '.$_POST['LastName'];
but it didn't work.
*/
?>2-in the php.ini i modified the register_globals and put the value: On -but no result.
3- and after 3 hours of searching without any reasult : i modified the register_long_arrays to : On -even it don't solve my problem
and post_max_size already = 8M
4- i checked the variables_order and yes it has the value of : "GPCS" and about the request_order it has the value "GP".
5-some people on the web was talking about mod_bandwidth i didn't find it in the httpd.conf !!they said it should be disabled or or or ..etc..
after 5 hours i used another code to test it
Code: Select all
<html>
<head><title>Register</title></head>
<body>
<?php
if (!isset ($_POST['register']) ||($_POST['register'] !='Register')) {
?>
<h1>Registration</h1>
<form method="get" action="register.php">
<table>
<tr><td>E-mail address:</td>
<td><input type='text' name='email'/></td></tr>
<tr><td>First name:</td>
<td><input type='text' name='first_name'/></td></tr>
<tr><td>Last name:</td>
<td><input type='text' name='last_name'/></td></tr>
<tr><td>Password:</td>
<td><input type='password' name='password'/></td></tr>
<tr>
<td colspan='2'>
<input type='submit' name='register' value='Register'/>
</td>
</tr>
</table>
</form>
<?php
} else {
?>
E-mail: <?php echo $_POST['email']; ?><br />
Name: <?php echo $_POST['first_name']. ' '. $_POST['last_name'];
?><br />
Password: <?php echo $_POST['password']; ?><br />
<?php
}
?>
</body>
</html>
thank you all