4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 help with php signup form
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
hailvarg
Junior WebHelper
Junior WebHelper


Joined: 04 Jul 2004
Posts: 2
Location: http://www.ryanormrod.com

PostPosted: Sun Jul 04, 2004 9:16 pm (13 years, 5 months ago) Reply with QuoteBack to Top

ok, well i wrote this signup form, but it doesnt submit the details needed, the page just stays white. i took the user and pass out for obvious reasons and changed the db name to something similar to before incase that is the problem. Please help me if you can, thanks.

Code:
<?php
if ($_POST["user"] <>"") $l = $l +1; else echo "Enter UserName";
if ($_POST["pass"] <>"") $l = $l +1; else echo "Enter Password";
if ($_POST["pass2"] <>"") $l = $l +1; else echo "verfiy password";
if ($_POST["email"] <>"") $l = $l +1; else echo "Enter an email";
if ($_POST["email2"] <>"") $l = $l +1; else echo "verify email";
if ($_POST["pass"] == $_POST["pass2"]) $l = $l +1; else echo "Password does not match";
if ($_POST["email"] == $_POST["email2"]) $l = $l +1; else echo "Email does not match";
$IP = $_SERVER['REMOTE_ADDR'];
$cdate = date("y-m-d");
$level = admin;

if (l==7) {
$conn = mysql_connect("localhost","","") or die ("Could not connect to mysql because ".mysql_error());
$db = mysql_select_db("klhgye") or die ("Could not select database because ".mysql_error());

$check = "select * from tdb where tws = '".$_POST['user']."';";
$qry = mysql_query($check) or die ("Could not match data because ".mysql_error());
$num_rows = mysql_num_rows($qry);
if ($num_rows != 0) {
echo "Sorry, that username is already taken.<br>";
exit;
} else {

$insert = mysql_query("INSERT INTO tdb (tus, tpw, email, ip, dt, lvl) VALUES ('".$_POST['user']."','".$_POST['pass']."','".$_POST['email']."',' $IP ',' $cdate ',' $level ')") or die (mysql_error());

echo "Signed up, Login to edit profile</a>";
}
} else {
echo " $conn; $level; $db; $insert; $IP; $cdate; ";
}
?>


OfflineView User's ProfileFind all posts by hailvargSend Personal MessageVisit Poster's Website
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Mon Jul 05, 2004 7:18 am (13 years, 5 months ago) Reply with QuoteBack to Top

Could it be that this:
if (l==7) {

should be
if ($l==7) {
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.048057 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme