Validating data php

Posted by / 03-Jan-2020 04:11

Validating data php

/^(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..So, in the next step we will be creating a class to validate inputs in a more convenient way.

If you have any kind of question to ask, comment below. Furthemore, Chrome display simple additional interface. If you don't write anything in input or write it in bad format (correctly is following: '1919-12-23'), you will get the first statement.If you write everything in good format, but you type wrong date (I assumed that nobody could born before XX century), your controller will send the second statement. Then, we make a page to show usernames of the users.So, PHP will echo out above HTML code as his username.

validating data php-62validating data php-71validating data php-58

This tutorial gained your knowledge on validating emails, URLs, integers, booleans and more.

One thought on “validating data php”

  1. Whether you consider him the answer to a fractured nation’s prayers or […] One of the scariest things about a new relationship can be figuring out when and where to say those three magic words. Despite stereotypes about the British being reserved, it seems we’re relatively forthcoming when it comes to declarations of love.