3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<!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 7.0.0 - 7.1.0
<!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 5.3.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.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.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)