3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php// $con = mysql_connect("localhost","fazia_newadmin","salonspa!@#") or die("Could not Connect");//mysql_select_db("fazia_newdb", $con); $con = mysql_connect("localhost","root","") or die("Could not Connect");mysql_select_db("salon", $con);extract($_REQUEST);//if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email))//{//$regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/'; //if (preg_match($regex, $email)) {if(filter_var($email, FILTER_VALIDATE_EMAIL)){ $sql = "select * from user where email_id='$email'"; $rsd = mysql_query($sql); $msg = mysql_num_rows($rsd); echo $msg; } else { echo "invalid"; } //echo $msg;//returns 0 if not already exist ?>
based on dTLt7
Output for 5.4.34 - 7.1.0
Notice: Use of undefined constant php - assumed 'php' in /in/u9qCN on line 1
Output for 4.3.0 - 5.4.32
<?php// $con = mysql_connect("localhost","fazia_newadmin","salonspa!@#") or die("Could not Connect");//mysql_select_db("fazia_newdb", $con); $con = mysql_connect("localhost","root","") or die("Could not Connect");mysql_select_db("salon", $con);extract($_REQUEST);//if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email))//{//$regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/'; //if (preg_match($regex, $email)) {if(filter_var($email, FILTER_VALIDATE_EMAIL)){ $sql = "select * from user where email_id='$email'"; $rsd = mysql_query($sql); $msg = mysql_num_rows($rsd); echo $msg; } else { echo "invalid"; } //echo $msg;//returns 0 if not already exist ?>