3v4l.org

run code in 300+ PHP versions simultaneously
<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 git.master, git.master_jit, rfc.property-hooks
<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(): open_basedir restriction in effect. File(config.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/pTdoc on line 24 Warning: include(config.php): Failed to open stream: Operation not permitted 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.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.45 ms | 402 KiB | 8 Q