Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender

EchoFool's Achievements

Advanced Member

Advanced Member (4/5)



  1. Hey, Say i had two strings assigned to different variables like $var = 'Hello there, how are you ?'; $var2 = 'Hello there, how are you today?'; I want to get a function automatically highlight whats different between the two by - say for example highlighting the added words in a red font. So like the result would show (after comparison) Hello there, how are you today? Is there a built in function for such a thing or is this a make your own function moment?
  2. The rainbow tables must have millions of rows of data then !
  3. LOL how did you de-crypt that? Is that with php? Because I am looking for something like that. MishieMoo - you were correct about the database ! Thanks ! But can de-cryption be done in php ?
  4. I am using a password encryption for my registration of: <?php $Password = mysql_real_escape_string($_POST['Password']); $Password = md5($Password); ?> But on login process form where i have: <?php $Username = mysql_real_escape_string($_POST['Username']); $Password = mysql_real_escape_string($_POST['Password']); $Password = md5($Password); ?> It doesn't match up. Then I thought about using a "request forgotten password feature", but how can the php de-crypt it in order to tell the user what their actual password was via email if they ever forgot ? Because at the moment I cannot login, as the encryption codes do not match. Yet for the same password on input it is only doing: The database encrypted password is: Which is what is throwing it out, for some reason I cannot work out why.
  5. I don't follow.. I got this function from a tutorial on how to validate emails... This was where I had got it from: http://www.spoono.com/php/tutorials/tutorial.php?id=41 I just didn't do the latter check which is to check the domain was real or not. As you can see I am still quite new to this type of validation.
  6. mysql_real_escape_string wont affect the @ symbol. Does the email address validate if you don't run mysql_real_escape_string Hmm no it doesn't it still returns false Crayon Violent - Good point, I shall put it in my function once I have solved this email validation, thankyou. What other options have I got to get this email working, what would you do to validate email ?
  7. So i should removed the mysql_real_escape_string from it ? But what if some one puts the email: '"@test.com ? Won't the ' or " crash it ?
  8. I have a function to check an email validity, but it just always returns false even if I input a valid email :S This is what i have: <?php //function function checkEmail($Email) { if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $Email)) { return TRUE; }Else{ return FALSE; } } //end function //processing $Email = mysql_real_escape_string($_POST['Email']); If(strlen($Email) > 50){ Header("location: Login.php?register&EmailError"); Die; } if(checkEmail($Email) == FALSE){ //this is where it headers out every time Header("location: Login.php?register&EmailError"); Die; } ?> Where did I go wrong ? Hope you can help! Thanks!
  9. Argh got it working now, used AndyB's suggestion. Thanks guys for the help!
  10. For some unknown reason which I cannot figure out, when I hit my submit button the form won't run. It does go into the script but I think something relating to my function might be the cause but I need some expert to double check because I am unsure on where my mistake is. No error is outputted, just nothing happens upon Submit being pressed. Form: <form name="" method="POST" action="login.php" id="Form1"> <p align=center> <span class=blackBold> Username (20 characters max!) <input type="text" size="20" name="Username" value=""><br><br> Password (20 characters max!) <input type="password" size="20" name="Password" value=""><br><br> Re-Enter (20 characters max!) <input type="password2" size="20" name="Password" value=""><br><br> Email (Must be valid!) <input type="text" size="50" name="Email" value=""><br><br> Please Enter the Code you see! <img src="CaptchaSecurityImages.php"> <input id="security_code" name="security_code" type="text"><br><br> </span> <input type="image" name="Register" src="../images/dcregister.jpg" width="100" height="25"><br> </p> </form> Process code: <?php If(isset($_POST['Register'])){ //check email validity function checkEmail($Email) { if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $Email)) { return FALSE; } list($EmailName, $EmailDomain) = split("@",$Email); if(getmxrr($Domain, $MXHost)) { return TRUE; } else { if(fsockopen($Domain, 25, $errno, $errstr, 30)) { return TRUE; } else { return FALSE; } } } //check captcha input match If($_SESSION['security_code'] != $_POST['security_code'] || empty($_SESSION['security_code'])) { Header("location: Login.php?register&SecurityCodeError"); Die; } //check username $Username = mysql_real_escape_string($_POST['Username']); If(strlen($Username) > 20 OR strlen($Username)< 1 OR !(preg_match("/^\w+$/",$Username))){ Header("location: Login.php?register&UsernameError"); Die; } //check password $Password = mysql_real_escape_string($_POST['Password']); If(strlen($Password) > 20 OR strlen($Password) < 5 OR !(ctype_alnum($Password))){ Header("location: Login.php?register&PasswordError1"); Die; } //check re-entry of password $Password2 = mysql_real_escape_string($_POST['Password2']); If ($Password != $Password2) { Header("location: Login.php?register&PasswordError2"); Die; } //check string length of email $Email = mysql_real_escape_string($_POST['Email']); If(strlen($Email) > 50){ Header("location: Login.php?Register&EmailError"); Die; } //calls function to check email validity if(checkEmail($Email) == FALSE){ Header("location: Login.php?Register&EmailError"); Die; } //username exists check $CheckUsername = mysql_query("SELECT Username FROM `usertable` WHERE `Username` = '$Username'"); If (mysql_num_rows($CheckUsername)>0) { Header("location: Login.php?register&UsernameTakenError"); Die; } // email exists check $CheckEmail = mysql_query("SELECT Email FROM `usertable` WHERE `Email` = '$Email'"); If (mysql_num_rows($CheckEmail)>0) { Header("location: Login.php?register&EmailTakenError"); Die; } $IP = $_SERVER["REMOTE_ADDR"]; $Date = date("Y-m-d H:i:s",time()); $Password = md5($Password); $EmailCode = md5(uniqid(rand(), true)); $Query = "INSERT INTO `usertable` (Username,Password,Email,IP,RegisterDate,ActivateCode) Values ('$Username', '$Password', '$Email', '$Country', '$IP', '$Date', '$EmailCode')"; mysql_query($Query) or die(mysql_error()); Unset($_SESSION['security_code']); Header("location: Login.php?Register&Success"); } ?> Hope you can help me out. Thanks!
  • 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.