$_post is empty!
Posted: Mon Jul 28, 2008 5:54 am
Hi!
I am trying to create a user registration page. I have created the registration form called "register.html". This is where the user enter the information. When the user press submit it should put that information into the post array and direct the user to add_user.php. Currently this isn't finished and only checks if data has been entered into the form. But it always says that there is no data in the post array.
Here is the code for register.html
Here is the code for add_user.php
This always returns line 8,9 and 10. Please could someone help me!!
Thanks
Ben
I am trying to create a user registration page. I have created the registration form called "register.html". This is where the user enter the information. When the user press submit it should put that information into the post array and direct the user to add_user.php. Currently this isn't finished and only checks if data has been entered into the form. But it always says that there is no data in the post array.
Here is the code for register.html
Code: Select all
<html>
<head>
<title>Registration</title>
</head>
<body>
<font size="3" face="Arial" color="red">
<h1>Registration page</h1>
Welcome to my site this is the registration page for access to exclusive news and features.<br>
<form action="add_user.php" method=post>
<label for="username">Username:</label>
<input type="text" name="username" id="username"><br>
<label for="password">password:</label>
<input type="password" name="password" id="password"><br>
<label for="confirm_password">Confirm password:</label>
<input type="password" name="confirm_password" id="confirm_password"><br>
<label for="full_name">Full name:</label>
<input type="text" name="full_name" id="full_name"><br>
<label for="email1">Email address:</label>
<input type="text" name="email1" id="email1"><br>
<lael for="email2">Confirm Email Address</label>
<input type="text" name="email2" id="email2">
<br>
<input type="submit" value="submit">
</form>
</html>Code: Select all
<?
//connect to mysql and select database
include 'C:\webserver\include\login\connect.php';
//checks if info has been put into each field if one field has no info echo and die
if (($_post['username']==false)||($_post['password']==false)||
($_post['confirm_password']==false)||($_post['full_name']==false)||
($_post['email1']==false)||($_post['email2']==false))
{echo "Please fill in all fields.";
include 'register.php'
;die();}
?>Thanks
Ben