3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> <title>Sale</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="sales.php" method="POST"> <div id="container"> <div id="header"><div id="header_left"></div> <div id="header_main"><b><font face="Arial" style="font-size: 14pt">Sales</font></b></div><div id="header_right"></div></div> <div id="content"> <table class="countTable"> <tr><td><font style="font-size: 14pt" color="#0066FF">Sales ID <select name="sales_id"> <option> </option> </select> <br> <br> Customer ID <select name="customer_id"> <option value=""></option> <?php include 'config.php'; mysql_select_db("ndi_db" ,$con); $result=mysql_query("SELECT * from Customers_tbl"); while($row=mysql_fetch_array($result)) { echo "<option value=".$row['Customer_id'].">".$row['Customer_name']."</option>"; } ?> </select> <br> <br> Sales Date <input type="text" name="sales_date"> <br> <br> <input type="submit" value="send" class="sub" name="submit"> <br> <br> <br> </font></td><td> <br> <br> <tr><th colspan="2" id="remain"><span style="font-weight: 400"> <br> <tr><td><font face="Tahoma" style="font-size: 10pt" color="#0066FF"> <a href="product.php">Product Form</a> | <a href="disease.php">Diseases Form</a> | <a href="throuput.php">Throuput Form</a> | <a href="throuputdetails.php">Throuput Details Form</a> | <a href="sales.php">Sales Form</a> | <a href="salesdetails.php">Sales Details Form</a> | <a href="customers.php">Customers Form</a> </font></td><td> <font face="Tahoma" style="font-size: 10pt"></font></td></tr> </table> </div> </div> </form> </body> </html> <?php if(isset($_POST['submit'])) { include "config.php"; mysql_select_db("ndi_db",$con); $insert="INSERT INTO Sales_tbl (Customer_id,Sales_date) values('$_POST[customer_id]','$_POST[sales_date]')"; mysql_query($insert,$con); } ?> <?php include "config.php"; mysql_select_db("NDI_DB", $con); $select = mysql_query("SELECT * FROM sales_tbl ORDER BY sales_id DESC"); echo "<table border=1 >"; echo "<tr>"; echo "<th>Sales ID</th>"; echo "<th>Customer ID</th>"; echo "<th>Sales Date</th>"; echo "<th>Delete</th>"; echo "</tr>"; while($row=mysql_fetch_array($select)) { echo "<tr>"; echo "<td>" .$row['Sales_id'] ."</td>"; echo "<td>" .$row['Customer_id'] ."</td>"; echo "<td>" .$row['Sales_date'] ."</td>"; echo "<td>"."<a href='sales.php?id=$row[Sales_id]'> Delete </a>". "</td>"; echo"</tr>"; } if(isset($_GET["id"])) { mysql_query("Delete FROM sales_tbl WHERE sales_id=".$_GET["id"]); } echo "</table>"; ?>
Output for 7.0.0 - 7.1.0
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> <title>Sale</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="sales.php" method="POST"> <div id="container"> <div id="header"><div id="header_left"></div> <div id="header_main"><b><font face="Arial" style="font-size: 14pt">Sales</font></b></div><div id="header_right"></div></div> <div id="content"> <table class="countTable"> <tr><td><font style="font-size: 14pt" color="#0066FF">Sales ID <select name="sales_id"> <option> </option> </select> <br> <br> Customer ID <select name="customer_id"> <option value=""></option> Warning: include(config.php): failed to open stream: No such file or directory in /in/pTdoc on line 24 Warning: include(): Failed opening 'config.php' for inclusion (include_path='.:') in /in/pTdoc on line 24 Fatal error: Uncaught Error: Call to undefined function mysql_select_db() in /in/pTdoc:25 Stack trace: #0 {main} thrown in /in/pTdoc on line 25
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> <title>Sale</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="sales.php" method="POST"> <div id="container"> <div id="header"><div id="header_left"></div> <div id="header_main"><b><font face="Arial" style="font-size: 14pt">Sales</font></b></div><div id="header_right"></div></div> <div id="content"> <table class="countTable"> <tr><td><font style="font-size: 14pt" color="#0066FF">Sales ID <select name="sales_id"> <option> </option> </select> <br> <br> Customer ID <select name="customer_id"> <option value=""></option> Warning: File not found: config.php in /in/pTdoc on line 24 Notice: Undefined variable: con in /in/pTdoc on line 25 Warning: supplied argument is not a valid MySQL-Link resource in /in/pTdoc on line 25 Warning: supplied argument is not a valid MySQL-Link resource in /in/pTdoc on line 26 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /in/pTdoc on line 27 </select> <br> <br> Sales Date <input type="text" name="sales_date"> <br> <br> <input type="submit" value="send" class="sub" name="submit"> <br> <br> <br> </font></td><td> <br> <br> <tr><th colspan="2" id="remain"><span style="font-weight: 400"> <br> <tr><td><font face="Tahoma" style="font-size: 10pt" color="#0066FF"> <a href="product.php">Product Form</a> | <a href="disease.php">Diseases Form</a> | <a href="throuput.php">Throuput Form</a> | <a href="throuputdetails.php">Throuput Details Form</a> | <a href="sales.php">Sales Form</a> | <a href="salesdetails.php">Sales Details Form</a> | <a href="customers.php">Customers Form</a> </font></td><td> <font face="Tahoma" style="font-size: 10pt"></font></td></tr> </table> </div> </div> </form> </body> </html> Warning: File not found: config.php in /in/pTdoc on line 94 Notice: Undefined variable: con in /in/pTdoc on line 95 Warning: supplied argument is not a valid MySQL-Link resource in /in/pTdoc on line 95 Warning: supplied argument is not a valid MySQL-Link resource in /in/pTdoc on line 96 <table border=1 ><tr><th>Sales ID</th><th>Customer ID</th><th>Sales Date</th><th>Delete</th></tr> Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /in/pTdoc on line 105 </table>
Output for 5.1.0 - 5.6.25
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> <title>Sale</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="sales.php" method="POST"> <div id="container"> <div id="header"><div id="header_left"></div> <div id="header_main"><b><font face="Arial" style="font-size: 14pt">Sales</font></b></div><div id="header_right"></div></div> <div id="content"> <table class="countTable"> <tr><td><font style="font-size: 14pt" color="#0066FF">Sales ID <select name="sales_id"> <option> </option> </select> <br> <br> Customer ID <select name="customer_id"> <option value=""></option> Warning: include(config.php): failed to open stream: No such file or directory in /in/pTdoc on line 24 Warning: include(): Failed opening 'config.php' for inclusion (include_path='.:') in /in/pTdoc on line 24 Fatal error: Call to undefined function mysql_select_db() in /in/pTdoc on line 25
Process exited with code 255.
Output for 5.0.0 - 5.0.5
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> <title>Sale</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="sales.php" method="POST"> <div id="container"> <div id="header"><div id="header_left"></div> <div id="header_main"><b><font face="Arial" style="font-size: 14pt">Sales</font></b></div><div id="header_right"></div></div> <div id="content"> <table class="countTable"> <tr><td><font style="font-size: 14pt" color="#0066FF">Sales ID <select name="sales_id"> <option> </option> </select> <br> <br> Customer ID <select name="customer_id"> <option value=""></option> Warning: main(config.php): failed to open stream: No such file or directory in /in/pTdoc on line 24 Warning: main(): Failed opening 'config.php' for inclusion (include_path='.:') in /in/pTdoc on line 24 Fatal error: Call to undefined function mysql_select_db() in /in/pTdoc on line 25
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> <title>Sale</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="sales.php" method="POST"> <div id="container"> <div id="header"><div id="header_left"></div> <div id="header_main"><b><font face="Arial" style="font-size: 14pt">Sales</font></b></div><div id="header_right"></div></div> <div id="content"> <table class="countTable"> <tr><td><font style="font-size: 14pt" color="#0066FF">Sales ID <select name="sales_id"> <option> </option> </select> <br> <br> Customer ID <select name="customer_id"> <option value=""></option> Warning: main(config.php): failed to open stream: No such file or directory in /in/pTdoc on line 24 Warning: main(): Failed opening 'config.php' for inclusion (include_path='.:') in /in/pTdoc on line 24 Notice: Undefined variable: con in /in/pTdoc on line 25 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /in/pTdoc on line 25 Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/pTdoc on line 26 Warning: mysql_query(): A link to the server could not be established in /in/pTdoc on line 26 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /in/pTdoc on line 27 </select> <br> <br> Sales Date <input type="text" name="sales_date"> <br> <br> <input type="submit" value="send" class="sub" name="submit"> <br> <br> <br> </font></td><td> <br> <br> <tr><th colspan="2" id="remain"><span style="font-weight: 400"> <br> <tr><td><font face="Tahoma" style="font-size: 10pt" color="#0066FF"> <a href="product.php">Product Form</a> | <a href="disease.php">Diseases Form</a> | <a href="throuput.php">Throuput Form</a> | <a href="throuputdetails.php">Throuput Details Form</a> | <a href="sales.php">Sales Form</a> | <a href="salesdetails.php">Sales Details Form</a> | <a href="customers.php">Customers Form</a> </font></td><td> <font face="Tahoma" style="font-size: 10pt"></font></td></tr> </table> </div> </div> </form> </body> </html> Warning: main(config.php): failed to open stream: No such file or directory in /in/pTdoc on line 94 Warning: main(): Failed opening 'config.php' for inclusion (include_path='.:') in /in/pTdoc on line 94 Notice: Undefined variable: con in /in/pTdoc on line 95 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /in/pTdoc on line 95 Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/pTdoc on line 96 Warning: mysql_query(): A link to the server could not be established in /in/pTdoc on line 96 <table border=1 ><tr><th>Sales ID</th><th>Customer ID</th><th>Sales Date</th><th>Delete</th></tr> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /in/pTdoc on line 105 </table>
Output for 4.3.0 - 4.3.1
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> <title>Sale</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="sales.php" method="POST"> <div id="container"> <div id="header"><div id="header_left"></div> <div id="header_main"><b><font face="Arial" style="font-size: 14pt">Sales</font></b></div><div id="header_right"></div></div> <div id="content"> <table class="countTable"> <tr><td><font style="font-size: 14pt" color="#0066FF">Sales ID <select name="sales_id"> <option> </option> </select> <br> <br> Customer ID <select name="customer_id"> <option value=""></option> Warning: main(config.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/pTdoc on line 24 Warning: main() [http://www.php.net/function.main]: Failed opening 'config.php' for inclusion (include_path='.:') in /in/pTdoc on line 24 Notice: Undefined variable: con in /in/pTdoc on line 25 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /in/pTdoc on line 25 Warning: mysql_query() [http://www.php.net/function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/pTdoc on line 26 Warning: mysql_query() [http://www.php.net/function.mysql-query]: A link to the server could not be established in /in/pTdoc on line 26 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /in/pTdoc on line 27 </select> <br> <br> Sales Date <input type="text" name="sales_date"> <br> <br> <input type="submit" value="send" class="sub" name="submit"> <br> <br> <br> </font></td><td> <br> <br> <tr><th colspan="2" id="remain"><span style="font-weight: 400"> <br> <tr><td><font face="Tahoma" style="font-size: 10pt" color="#0066FF"> <a href="product.php">Product Form</a> | <a href="disease.php">Diseases Form</a> | <a href="throuput.php">Throuput Form</a> | <a href="throuputdetails.php">Throuput Details Form</a> | <a href="sales.php">Sales Form</a> | <a href="salesdetails.php">Sales Details Form</a> | <a href="customers.php">Customers Form</a> </font></td><td> <font face="Tahoma" style="font-size: 10pt"></font></td></tr> </table> </div> </div> </form> </body> </html> Warning: main(config.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/pTdoc on line 94 Warning: main() [http://www.php.net/function.main]: Failed opening 'config.php' for inclusion (include_path='.:') in /in/pTdoc on line 94 Notice: Undefined variable: con in /in/pTdoc on line 95 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /in/pTdoc on line 95 Warning: mysql_query() [http://www.php.net/function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/pTdoc on line 96 Warning: mysql_query() [http://www.php.net/function.mysql-query]: A link to the server could not be established in /in/pTdoc on line 96 <table border=1 ><tr><th>Sales ID</th><th>Customer ID</th><th>Sales Date</th><th>Delete</th></tr> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /in/pTdoc on line 105 </table>