supanoob Posted March 23, 2006 Share Posted March 23, 2006 <?phprequire_once('header.php');{include_once('regform.php');}if (!$_POST['username'] || !$_POST['email'] || !$_Password['password']){echo 'Sorry, you did not fill in all fields fields.';die();}if ($_POST['username'] && $_POST['email'] && $_POST['password']){$user=$_POST['username'];$email=$_POST['email'];$password=$_POST['password'];$username= trim($username);$email=trim($email);$password=trim($password);//check length of stringsif (strlen($username) < 5 || strlen($username) > 10){echo 'Sorry, username must be between 5 and 10 characters long';include_once('signupform.php');include_once('footer.php');die();} // check username$query="select * from users where user='$username'";$result=mysql_query($query);if (!$result){die (mysql_error());}$num_rows=mysql_num_rows($result);if ($num_rows > 0){echo "Sorry, username $username is taken.";include_once('signupform.php');include_once('footer.php');die();}//check email$query="select * from users where email='$email'";$result=mysql_query($query);if (!$result){die (mysql_error());}$num_rows=mysql_num_rows($result);if ($num_rows > 0){echo 'Sorry, that email address already has an account with us.';include_once('signupform.php');include_once('footer.php');die();}$query="insert into logs (account, type) values ('$email', 'signup')";$result=mysql_query($query);if (!$result){die (mysql_error());}$from = "From: webmaster@twottk.com";$subject="The War Of The Three Kingdoms - login details";$body = "Your Login Details are below \n\nYour Username is : $username\n Your Password is $password\n\nIf you did not signup to our website, please simply ignore this email. Please do not reply to this email.\n Thanks, \n";mail ($email, $subject, $body, $from);echo "You have signed up as $username! An email containing your login details has been sent to $email. Please keep this in case you forget your password. If you do not recieve this email within the next half hour, please check the spam filters on your inbox. Contact me at <a href=mailto:webmaster@twottk.com>webmaster@twottk.com</a> if you have any problems. Thank you.";}?>all it does is takes you back to the same page when i click submit :S www.twottk.com/game/signup2.phpwell yeah see for yourselves any advice would be great thabnks Quote Link to comment https://forums.phpfreaks.com/topic/5624-reg-forms/ Share on other sites More sharing options...
shortj75 Posted March 25, 2006 Share Posted March 25, 2006 you do not have set to redirect the user after the registration is completed add [code]header("Location: your_next_page.php"); [/code]after this[code]echo "You have signed up as $username! An email containing your login details has been sent to $email. Please keep this in case you forget your password. If you do not recieve this email within the next half hour, please check the spam filters on your inbox. Contact me at <a href=mailto:webmaster@twottk.com>webmaster@twottk.com</a> if you have any problems. Thank you.";[/code]and you will be redirected your desired next page after your email is sent Quote Link to comment https://forums.phpfreaks.com/topic/5624-reg-forms/#findComment-20506 Share on other sites More sharing options...
supanoob Posted March 25, 2006 Author Share Posted March 25, 2006 thanks i will try this later :d Quote Link to comment https://forums.phpfreaks.com/topic/5624-reg-forms/#findComment-20513 Share on other sites More sharing options...
norman100 Posted March 25, 2006 Share Posted March 25, 2006 [!--quoteo(post=358183:date=Mar 25 2006, 05:26 AM:name=supanoob)--][div class=\'quotetop\']QUOTE(supanoob @ Mar 25 2006, 05:26 AM) [snapback]358183[/snapback][/div][div class=\'quotemain\'][!--quotec--]thanks i will try this later :d[/quote]<?phprequire_once('header.php');{include_once('regform.php');}////////////////////////////////////////////////////////////////////////////////////////////if (!$_POST['username'] || !$_POST['email'] || !$_Password['password']){echo 'Sorry, you did not fill in all fields fields.';}//////////////////////////////////////////////////////////////////////////////////////////////$_Password try changing this too $_POST['password'];Also you will get a t_boolean, there is a parse error in your "OR" STATEMENT if (!$_POST['username'] )|| (!$_POST['email']) || (!$_Password['password'])){echo 'Sorry, you did not fill in all fields fields.';}try the above im a bit limited for time right now but i will check back later Quote Link to comment https://forums.phpfreaks.com/topic/5624-reg-forms/#findComment-20535 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.