Jump to content

GB_001

Members
  • Posts

    187
  • Joined

  • Last visited

    Never

Everything posted by GB_001

  1. It's shortening my md5 encrypted passwords to 30 characters, please help. Thankyou. My registry code: <?php @mysql_connect("localhost", "gb_GB", "***********") or die(mysql_error()); @mysql_select_db("gb_USERInfo") or die(mysql_error()); $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $email = $_POST['email']; $aboutme = $_POST['aboutme']; $interests = $_POST['interests']; $pword = md5($_POST['password']); $emailedpass = $_POST['password']; $checkuser = mysql_query("SELECT email FROM Ysers WHERE email='$email'"); $email_exist = mysql_num_rows($checkuser); if($email_exist > 0){ echo "I'm sorry but the email you specified is already in use."; unset($email); include 'Register.html'; exit(); }else{ $query = "INSERT INTO Ysers (firstname, lastname, email, aboutme, interests, password) VALUES('$firstname', '$lastname', '$email', '$aboutme', '$interests', '$pword')"; mysql_query($query) or die(mysql_error()); mysql_close(); echo "You have successfully Registered."; $site = "www.gbchat.elementfx.com"; $webmaster = "info@gbchat"; $semail = "info@gbchat.elementfx.com"; $subject = "You have successfully registered at $site..."; $message = "Dear $firstname, you are now registered at gbchat. To login, simply go to our web page and enter in the following details in the login form: Username: $email Password: $emailedpass Please print this information out and store it for future reference. Thanks, $webmaster"; mail($email, $subject, $message, "From: $site <$semail>\nX-Mailer:PHP/" . phpversion()); echo " Your information has been mailed to your email address."; echo $pword; } ?>
  2. Thankyou, I have pinpointed the problem, it has to do with the passwords. For some reason even right passwords are being flagged as wrong.
  3. Sorry, but it still does not seem to be working. Here is what I have: <?php $connect=mysql_connect("localhost","gb_GB","*********") or die(mysql_error()); mysql_select_db("gb_USERInfo",$connect)or die(mysql_error()); ob_start(); $email=$_POST['email']; $password=md5($_POST['password']); $error=null; $query="SELECT * FROM `Ysers` WHERE `email`='$email' LIMIT 1"; $result=mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result)==0){ $error="Username does not exist."; }else{ $row=mysql_fetch_assoc($result); if($row['password']!=$password){ $error="Password incorrect."; }else{ $_SESSION['email']="$email"; setcookie("email","$email",time()+360000); setcookie("password","$password",time()+360000); include "memberspage.php"; } } if(!empty($error)){ include "Man.html"; print"MOMMY"; } ?>
  4. Thankyou again, but I think I may be doing something wrong because it still jumps straight to the debug message.
  5. Thankyou, it now somewhat works except I get a MySQL error involving my session. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/gb/public_html/Authenticate.php:1) in /home/gb/public_html/Authenticate.php on line 6
  6. Sorry, but it still doesn't work. It keeps jumping to the debug message I sent.
  7. For some reason, I cannot login. I just get redirected to my login page as if I entered the wrong information. Code: <?php @mysql_connect("localhost", "gb_GB", "*************") or die(mysql_error()); @mysql_select_db("gb_USERInfo") or die(mysql_error()); session_start(); $email = $_POST['email']; $password = md5($_POST['password']); $query = mysql_query("SELECT * FROM Ysers WHERE 'email'='$email' AND 'password'='$password' LIMIT 1;")or die(mysql_error()); $result = $query; if(!$result) { $err=mysql_error(); print $err; exit(); } $row=mysql_fetch_assoc($result); if($email==$row['email']&& $password==$row['password'] ){ $_SESSION['email'] = "$email"; setcookie("email","$email",time()+360000); setcookie("password","$password",time()+360000); include "memberspage.php"; } else { $error = "Bad Login"; include "Man.html"; print "MOMMY"; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.