3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? ob_start(); include ("access.inc"); $table_name = "mem_auth"; $connection = mysql_connect($host,$user,$password); $db = mysql_select_db($db_name, $connection) or die("Couldn't select databasea."); $sql = "SELECT * FROM $table_name WHERE roster = \"$Mroster\" AND pass_word = (\"$Mpass_word\") ";$result = mysql_query($sql) or die ("Can't execute query."); $num = mysql_numrows($result); while ($row = mysql_fetch_array($result)) { $rostera = $row['roster']; } if ($num == 0) { echo "Your information does not match that which is on file, please try again" ; exit; } else { session_start(); session_register('valid'); $valid = "yes"; } //$datea = (date); $dttm = (date ("Y-m-d H:i:s")); $today = (date ("M j,Y")); $todayB = (date ("Y-m-d")); //$connection = mysql_connect(tri-ess-org,sunrise_sunrise,Xtrem6fTy); $connection = mysql_connect($host,$user,$password); $db = @mysql_select_db($db_name, $connection) or die("Couldn't select databaseb."); $ip = $REMOTE_ADDR; $sql = "INSERT INTO member_login (login_Roster, login_Time, ip) VALUES ('$rostera','$dttm','$ip')"; mysql_query($sql); $sql = "SELECT * FROM member WHERE roster LIKE '$Mroster' "; $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); while ($row = mysql_fetch_array($result)) { $first = $row['first']; $rostera = $row['roster']; $doe = $row['doe']; } echo "Today is $today"; ob_end_flush(); ?> <HTML> <HEAD> <TITLE>Directory Search</TITLE> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .style3 { font-size: 12px; } --> </style> </HEAD> <BODY background="../images/backnice.gif"><body background="backgrnd.jpg"> <p align="center"><IMG SRC="/images/2002b50.gif" width="158" height="110"><br> <br> <b><font size="5"> Welcome <? echo "$first"; ?> to the member only area.</font></b><br> <br> <? $viewer = getenv("HTTP_USER_AGENT"); $browser = "an unidentified browser"; if( preg_match( "/MSIE/i", "$viewer")) { $browser = "Internet Explorer"; } else if (preg_match( "/Netscape/i", "$viewer")) { $browser = "Netscape"; } else if (preg_match( "/Opera/i", "$viewer")) { $browser = "Opera"; } else if (preg_match( "/Firefox/i", "$viewer")) { $browser = "Firefox"; } echo("<font size=4><strong>For your information:<br><br>"); echo("<font size=4><strong> The browser you are using is $browser </strong></font><br><br>"); $dates = (date ("M-d-Y")); $date_mdy = (date ("Y-m-d")); if ($doe > 2020-01-01) { echo "You have a lifetime membership-thank you"; } elseif ($doe > $date_mdy) { echo("<font size=4><strong> Your membership expires on "); echo(date("l F j, Y",strtotime("$doe"))) ; } else { echo "Your membership expired on "; echo(date("l F j, Y",strtotime ("$doe"))); echo ", please renew...Thank you"; exit; } ?>
Output for 7.0.0 - 7.1.0
Warning: include(access.inc): failed to open stream: No such file or directory in /in/tVKRS on line 3 Warning: include(): Failed opening 'access.inc' for inclusion (include_path='.:') in /in/tVKRS on line 3 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/tVKRS:7 Stack trace: #0 {main} thrown in /in/tVKRS on line 7
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: File not found: access.inc in /in/tVKRS on line 3 Notice: Undefined variable: host in /in/tVKRS on line 7 Notice: Undefined variable: user in /in/tVKRS on line 7 Notice: Undefined variable: password in /in/tVKRS on line 7 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/tVKRS on line 7 Notice: Undefined variable: db_name in /in/tVKRS on line 8 Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /in/tVKRS on line 8 Couldn't select databasea.
Output for 5.4.0 - 5.6.28
Warning: include(access.inc): failed to open stream: No such file or directory in /in/tVKRS on line 3 Warning: include(): Failed opening 'access.inc' for inclusion (include_path='.:') in /in/tVKRS on line 3 Fatal error: Call to undefined function mysql_connect() in /in/tVKRS on line 7
Process exited with code 255.
Output for 4.3.0 - 5.3.29
<? ob_start(); include ("access.inc"); $table_name = "mem_auth"; $connection = mysql_connect($host,$user,$password); $db = mysql_select_db($db_name, $connection) or die("Couldn't select databasea."); $sql = "SELECT * FROM $table_name WHERE roster = \"$Mroster\" AND pass_word = (\"$Mpass_word\") ";$result = mysql_query($sql) or die ("Can't execute query."); $num = mysql_numrows($result); while ($row = mysql_fetch_array($result)) { $rostera = $row['roster']; } if ($num == 0) { echo "Your information does not match that which is on file, please try again" ; exit; } else { session_start(); session_register('valid'); $valid = "yes"; } //$datea = (date); $dttm = (date ("Y-m-d H:i:s")); $today = (date ("M j,Y")); $todayB = (date ("Y-m-d")); //$connection = mysql_connect(tri-ess-org,sunrise_sunrise,Xtrem6fTy); $connection = mysql_connect($host,$user,$password); $db = @mysql_select_db($db_name, $connection) or die("Couldn't select databaseb."); $ip = $REMOTE_ADDR; $sql = "INSERT INTO member_login (login_Roster, login_Time, ip) VALUES ('$rostera','$dttm','$ip')"; mysql_query($sql); $sql = "SELECT * FROM member WHERE roster LIKE '$Mroster' "; $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); while ($row = mysql_fetch_array($result)) { $first = $row['first']; $rostera = $row['roster']; $doe = $row['doe']; } echo "Today is $today"; ob_end_flush(); ?> <HTML> <HEAD> <TITLE>Directory Search</TITLE> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .style3 { font-size: 12px; } --> </style> </HEAD> <BODY background="../images/backnice.gif"><body background="backgrnd.jpg"> <p align="center"><IMG SRC="/images/2002b50.gif" width="158" height="110"><br> <br> <b><font size="5"> Welcome <? echo "$first"; ?> to the member only area.</font></b><br> <br> <? $viewer = getenv("HTTP_USER_AGENT"); $browser = "an unidentified browser"; if( preg_match( "/MSIE/i", "$viewer")) { $browser = "Internet Explorer"; } else if (preg_match( "/Netscape/i", "$viewer")) { $browser = "Netscape"; } else if (preg_match( "/Opera/i", "$viewer")) { $browser = "Opera"; } else if (preg_match( "/Firefox/i", "$viewer")) { $browser = "Firefox"; } echo("<font size=4><strong>For your information:<br><br>"); echo("<font size=4><strong> The browser you are using is $browser </strong></font><br><br>"); $dates = (date ("M-d-Y")); $date_mdy = (date ("Y-m-d")); if ($doe > 2020-01-01) { echo "You have a lifetime membership-thank you"; } elseif ($doe > $date_mdy) { echo("<font size=4><strong> Your membership expires on "); echo(date("l F j, Y",strtotime("$doe"))) ; } else { echo "Your membership expired on "; echo(date("l F j, Y",strtotime ("$doe"))); echo ", please renew...Thank you"; exit; } ?>