Validating data php compare internet dating sites
EDIT: when it returns the data to the j Query script, this should happen: if yes: start session, redirect to page2with session started.else if act: write in a field that the account is not activated. The thing is, that when I try to write the correct e-mail and password - it continues to write : "email and password didn't match" instead of redirecting..Of course, validating user input is really important for dynamic websites. In this tutorial, you will learn about 4 major tasks. The awesome language, PHP has numerous in-built functions to validate user inputs.You can improve that class with your knowledge and make it more functional according to your needs.If you have any kind of question to ask, comment below. So, every user who visits this page will be redirected to function to validate variables.We can set it's second parameter to different values and use it to validate emails, URLs, integers, booleans, etc.
After deleting the old code it worked, but then I found something else to change, and that is in the PDO script when it is validating it says: $sql - $conn_business-prepare( "SELECT email, password FROM members WHERE email='".$email."'"); and then I just changed the '-' after $sql to '=' and now, everything works perfectly... This method can be used to validate any integer value such as a primary integer key (user Id, group Id, etc.) in database, timestamp, etc.The advantage of using this function is, it converts string numbers ( function./^(19[0-9]|2[0-9])\-(0[1-9]|1[0-2])\-(0[1-9]|1[0-9]|2[0-9]|3[0-1])((T|\s)(0[0-9]|1[0-9]|2[0-3])\:(0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])\:(0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])((\ |\.)[\d ])? I have tested that my DB login informations is correctly programmed for PDO.. session_start(); require_once("connect.php"); //get the posted values $email=htmlspecialchars($_POST['email'], ENT_QUOTES); $pass=md5($_POST['psw']); //now validating the username and password $sql="SELECT email, password members WHERE email='".$email."'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $sql2="SELECT * FROM members WHERE email='".$email."'"; $result2=mysql_query($sql2); $row2=mysql_fetch_array($result2); $act = $row2['activated']; //if username exists if(mysql_num_rows($result) Does anybody know, what I have done wrong? It is called through AJAX and return data based on 'no', 'yes' and 'act' that tells the AJAX/j Query script what to do..