3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Marks Sheet</title> <script type="text/javascript"> function mess() { window.alert("First row must be used for Column Heading"); } </script> </head> <body onLoad="mess()"> <?php $exam=$_POST['exam']; $sub=$_POST['sub']; $col=$_POST['col']; $row=$_POST['row']; /*echo $exam; echo "<br>"; echo $sub; echo "<br>"; echo $col; echo "<br>";*/ echo "<p align='center'<b><font size='+2'>". $exam . "</font></b></p>"; echo "<p align='center'<b><font size='+1'>". $sub . "</font></b></p>"; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("marks", $con); $result = mysql_query("SELECT * FROM vi"); while($row = mysql_fetch_array($result)) { echo $row['1']; echo "<br />"; } mysql_close($con); echo"<div align='center'"; echo "<form name='sheet' action='csheet.php' onsubmit='return check()' method='post'>"; echo"<table width='200' border='1'>"; for($a=1;$a<=$row;$a++) { echo"<tr bgcolor='#0099FF'>"; for($b=1;$b<=$col;$b++) { echo"<td><input type='text' name='' size='8' /></td>"; } echo"</tr>"; } echo"</table>"; echo "<input type='submit' value='Submit'>"; echo "</form></div>"; ?> </body> </html>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Marks Sheet</title> <script type="text/javascript"> function mess() { window.alert("First row must be used for Column Heading"); } </script> </head> <body onLoad="mess()"> Warning: Undefined array key "exam" in /in/D74hR on line 15 Warning: Undefined array key "sub" in /in/D74hR on line 16 Warning: Undefined array key "col" in /in/D74hR on line 17 Warning: Undefined array key "row" in /in/D74hR on line 18 <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/D74hR:24 Stack trace: #0 {main} thrown in /in/D74hR on line 24
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.33
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Marks Sheet</title> <script type="text/javascript"> function mess() { window.alert("First row must be used for Column Heading"); } </script> </head> <body onLoad="mess()"> Notice: Undefined index: exam in /in/D74hR on line 15 Notice: Undefined index: sub in /in/D74hR on line 16 Notice: Undefined index: col in /in/D74hR on line 17 Notice: Undefined index: row in /in/D74hR on line 18 <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/D74hR:24 Stack trace: #0 {main} thrown in /in/D74hR on line 24
Process exited with code 255.
Output for 7.3.32 - 7.3.33
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Marks Sheet</title> <script type="text/javascript"> function mess() { window.alert("First row must be used for Column Heading"); } </script> </head> <body onLoad="mess()"> <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/D74hR:24 Stack trace: #0 {main} thrown in /in/D74hR on line 24
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.25
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Marks Sheet</title> <script type="text/javascript"> function mess() { window.alert("First row must be used for Column Heading"); } </script> </head> <body onLoad="mess()"> Notice: Undefined index: exam in /in/D74hR on line 15 Notice: Undefined index: sub in /in/D74hR on line 16 Notice: Undefined index: col in /in/D74hR on line 17 Notice: Undefined index: row in /in/D74hR on line 18 <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Fatal error: Call to undefined function mysql_connect() in /in/D74hR on line 24
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Marks Sheet</title> <script type="text/javascript"> function mess() { window.alert("First row must be used for Column Heading"); } </script> </head> <body onLoad="mess()"> Notice: Undefined index: exam in /in/D74hR on line 15 Notice: Undefined index: sub in /in/D74hR on line 16 Notice: Undefined index: col in /in/D74hR on line 17 Notice: Undefined index: row in /in/D74hR on line 18 <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Fatal error: Call to undefined function mysql_connect() in /in/D74hR on line 24
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Marks Sheet</title> <script type="text/javascript"> function mess() { window.alert("First row must be used for Column Heading"); } </script> </head> <body onLoad="mess()"> Notice: Undefined index: exam in /in/D74hR on line 15 Notice: Undefined index: sub in /in/D74hR on line 16 Notice: Undefined index: col in /in/D74hR on line 17 Notice: Undefined index: row in /in/D74hR on line 18 <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/D74hR on line 24 Could not connect: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Output for 4.3.0 - 4.3.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Marks Sheet</title> <script type="text/javascript"> function mess() { window.alert("First row must be used for Column Heading"); } </script> </head> <body onLoad="mess()"> Notice: Undefined index: exam in /in/D74hR on line 15 Notice: Undefined index: sub in /in/D74hR on line 16 Notice: Undefined index: col in /in/D74hR on line 17 Notice: Undefined index: row in /in/D74hR on line 18 <p align='center'<b><font size='+2'></font></b></p><p align='center'<b><font size='+1'></font></b></p> Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/D74hR on line 24 Could not connect: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

preferences:
236.44 ms | 404 KiB | 355 Q