PHP is not parsing values through a form.
Posted: Sun Jun 13, 2004 4:16 am
Can somebody please help.
I use to develop webpages with php about 3 years back and at a reasonable level - however i never actually dealt with the setup of php and mysql etc - just coded.
Now the problem i've got is that when i create a page with a form on it and then try to parse the info through to the next page and insert into my table....there is no info appearing in the table.
It IS creating a row but with empty fields.
I have checked my html tags etc and is no problem with the actual basic code.
When i do a form to just display the values on the next page - nothing appears too.
I have been looking through the forums and notice that in the latest versions of php the php.ini file has the register_globals set to off - i have turned this on as it said it would help. No joy!
please see below my basic form code - can u see anything wrong here.....?
Add User Page
Added User Page
PLEASE HELP 
I use to develop webpages with php about 3 years back and at a reasonable level - however i never actually dealt with the setup of php and mysql etc - just coded.
Now the problem i've got is that when i create a page with a form on it and then try to parse the info through to the next page and insert into my table....there is no info appearing in the table.
It IS creating a row but with empty fields.
I have checked my html tags etc and is no problem with the actual basic code.
When i do a form to just display the values on the next page - nothing appears too.
I have been looking through the forums and notice that in the latest versions of php the php.ini file has the register_globals set to off - i have turned this on as it said it would help. No joy!
please see below my basic form code - can u see anything wrong here.....?
Add User Page
Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<FORM ACTION="add.php" METHOD="post" name="form">
Real Name:
<INPUT type="text" name="real_name" SIZE=20 MAXLENGTH=70>
<Br>
Username: <INPUT type="text" name="username" SIZE=20 MAXLENGTH=70>
<Br>
Password: <Input type="text" name="password" Size=10 Maxlength=70>
<Br>
E-mail address: <Input type="text" name="email" Size=20 Maxlength=70>
<Br>
<INPUT TYPE=submit VALUE="Add">
<INPUT type=reset VALUE="Reset Form">
</form>
</body>
</html>Code: Select all
<?php
mysql_connect("localhost","username","password");
mysql_select_db (test);
$query = ("INSERT INTO users (id, real_name, username, password, email)
VALUES ('$ID', '$real_name', '$username', '$password', '$email') ");
$result = mysql_query($query);
echo '$real_name Entered.';
?>