lalonde4 Posted May 29, 2012 Share Posted May 29, 2012 So I am creating a community site and I just can for the life of me figure out why this page is not working. <?php $title = "Productions - Register";?> <?php require("styles/top.php"); ?> <div id='full'> <?php $form = "<form action='register.php' method='post'> <table> <tr> <td>First Name:</td> <td><input type='text' name='firstname'><font color='red'>*</font></td> </tr> <tr> <td>Last Name:</td> <td><input type='text' name='lastname'><font color='red'>*</font></td> </tr> <tr> <td>Username:</td> <td><input type='text' name='username'><font color='red'>*</font></td> </tr> <tr> <td>Email:</td> <td><input type='text' name='email'><font color='red'>*</font></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='password'><font color='red'>*</font></td> </tr> <tr> <td>Confirm Password:</td> <td><input type='password' name='repassword'><font color='red'>*</font></td> </tr> <tr> <td>Avatar:</td> <td><input type='file' name='avatar'></td> </tr> <tr> <td>Bio/About Me:</td> <td><textarea name='bio' cols='35' rows='5'></textarea></td> </tr> <tr> <td>Website:</td> <td><input type='text' name='website'></td> </tr> <tr> <td>Youtube:</td> <td><input type='text' name='youtube'></td> </tr> <tr> <td>Facebook:</td> <td><input type='text' name='facebook'></td> </tr> <tr> <td>Twitter:</td> <td><input type='text' name='twitter'></td> </tr> <tr> <td></td> <td><input type='submit' name='submitbtn' value='Register'></td> </tr> <tr> <td></td> <td><font color='red'>*</font> = Required</td> </tr> </table> </form>"; if ($_POST['submitbtn']){ $firstname = strip_tags($_POST['firstname']); $lastname = strip_tags($_POST['lastname']); $username = strip_tags($_POST['username']); $email = strip_tags($_POST['email']); $password = strip_tags($_POST['password']); $repassword = strip_tags($_POST['repassword']); $bio = strip_tags($_POST['bio']); $website = strip_tags($_POST['webite']); $youtube = strip_tags($_POST['youtube']); $facebook = strip_tags($_POST['facebook']); $twitter = strip_tags($_POST['twitter']); $name = $_FILES['avatar']['name']; $type = $_FILES['avatar']['type']; $size = $_FILES['avatar']['size']; $tmpname = $_FILES['avatar']['tmp_name']; $ext = substr($name, strrpos($name, '.')); if ($firstname && $lastname && $username && $email && $password){ if ($password == $repassword){ if (strstr($email, "@") && strstr($email, ".") && (strlen($email) >=6)){ require("scripts/config.php"); $query = mysql_query("SELECT * FROM user WHERE username='$username'");$numrows = mysql_num_rows($query); if ($numrows == 0){ $query = mysql_query("SELECT * FROM users WHERE email='$email'");$numrows = mysql_num_rows($query); if ($numrows == 0){ $pass = md5($password); $date = date("F d, Y"); if ($name){ move_uploaded_file($tmpname, "avatars/$username.$ext"); } else $avatar = "defav.png"; $code = substr(md5(rand(111111111111, 999999999999)), 2,25); mysql_query("INSERT INTO table_users VALUES ('', '$firstname', '$lastname', '$email', '$pass', '$avatar', '$bio', '$website', '$youtube', '$facebook', '$twitter', '', '0', '$code', '0', '$date')"); $webmaster = "[email protected]"; $subject = "Activation Email"; $headers = "From: AAG GoD<$webmaster>"; $message = "Hello $username! Thank you for registering! Below is your activation link.\n\n You must click this link in order to log in. http://www.aagaming.net/productions/activate.php?code=$code"; mail($email, $subject, $message, $headers); echo "Your activation email has been sent to <b>$email</b>. There you will follow a link in order to login. You must complete the activation proccess in order to login. If you run into any problems please email the site administrators. Send an email to <a href='mailto:[email protected]'>[email protected]</a>"; } else echo"That email is already in use. $form"; } else echo"That username is already in use. $form"; } else echo "You did not enter a valid email. $form"; } else echo "Your passwords did not match. $form"; } else echo "You did not fill out all the required fields. $form"; } else echo "$form"; ?> </div> <?php require("styles/bottom.php"); ?> Link to comment https://forums.phpfreaks.com/topic/263299-help-idk-what-is-happening/ Share on other sites More sharing options...
Dusaro Posted May 29, 2012 Share Posted May 29, 2012 elaborate what you mean by "not working"? any errors? etc. Link to comment https://forums.phpfreaks.com/topic/263299-help-idk-what-is-happening/#findComment-1349386 Share on other sites More sharing options...
Philip Posted May 29, 2012 Share Posted May 29, 2012 Please see http://www.phpfreaks.com/forums/index.php?topic=360081.msg1702782#msg1702782 to continue this thread. Link to comment https://forums.phpfreaks.com/topic/263299-help-idk-what-is-happening/#findComment-1349389 Share on other sites More sharing options...
Recommended Posts