3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php include('../administracion/conexion.php'); if ($_POST) { $id = $_POST['name_id']; $no_identificacion = $_POST['name_no_identificacion']; $uso = $_POST['name_uso']; $no_pisos = $_POST['name_no_pisos']; $id_mezz = $_POST['name_mezzanine']; $id_estruc_princ = $_POST['name_estruc_princ']; if ($id) { $forma = 'insertar.php'; $sql='SELECT * FROM codigos '; $where = "WHERE id='$id' "; $cod = mysql_query($sql. $where, $con); if (!$cod) {echo "No se puedo efectaur la consulta de datos"; mysql_close($con); exit; } while ($filacod = mysql_fetch_array($cod)) { $sede=$filacod['sede']; $departamento=$filacod['departamento']; $municipio=$filacod['municipio']; } } else { $forma = 'captura.php'; } } else { $forma = 'captura.php'; } print("<form action = $forma method = 'post' name = 'formulario'>"); $colspan = '2'; print("<table align = 'center'>"); print("<tr><td align='right' colspan = '$colspan'><font color = 'red'><b>* = Campos obligatorios.</b></font></td></tr>"); print("<tr bgcolor='#D3DCE3'>"); print("<td align = 'center' colspan = '$colspan'><b>Estudio Sena</b></td>"); print("</tr>"); print("<tr>"); print("<td>C&oacute;digo<font color = 'red'><b> * </b></font></td>"); $sql = "SELECT * FROM codigos "; if ('$id') { $where = " "; } else { $where = "WHERE id=$id "; } $order = "ORDER BY id "; $cod = mysql_query($sql. $where. $order, $con); if (!$cod) { echo "No se puedo efectaur la consulta"; mysql_close($con); exit; } print("<td>"); print("<select name = 'name_id' onchange = 'submit()'>"); if (!$id) { print("<option value = ''> -- Seleccione Opci&oacute;n -- "); } while ($fila = mysql_fetch_array($cod)) { if ('$id' == $fila['id']) { print("<option value = '$fila[id]'>$fila[id] | $fila[sede]"); } else { print("<option value = '$fila[id]'>$fila[id] | $fila[sede]"); } } print("</select>"); print("</td>"); print("</tr>"); print("<tr>"); print("<td>Sede</td>"); print("<td><input name='sede' type='text' size='100' maxlength='100' value='$sede' readonly></td>"); print("</tr>"); print("<tr>"); print("<td>Departamento</td>"); print("<td><input name='departamento' type='text' size='50' maxlength='50' value='$departamento' readonly></td>"); print("</tr>"); print("<tr>"); print("<td>Municipio</td>"); print("<td><input name='municipio' type='text' size='50' maxlength='50' value='$municipio' readonly></td>"); print("</tr>"); print("<tr>"); print("<td>No. identificaci&oacute;n</td>"); print("<td><input name='name_no_identificacion' type='text' size='50' maxlength='50' value='$no_identificacion'></td>"); print("</tr>"); print("<tr>"); print("<td>Uso</td>"); print("<td><input name='name_uso' type='text' size='50' maxlength='50' value='$uso'></td>"); print("</tr>"); print("<tr>"); print("<td>No. Pisos</td>"); print("<td><input name='name_no_pisos' type='text' size='50' maxlength='50' value='$no_pisos'></td>"); print("</tr>"); print("<tr>"); print("<td>Mezzanine<font color = 'red'><b> * </b></font></td>"); $sql = "SELECT id AS id_mezz, descripcion FROM sino "; $where = " "; $order = "ORDER BY id_mezz "; $sino = mysql_query($sql. $where. $order, $con); if (!$sino) { echo "No se puedo efectaur la consulta"; mysql_close($con); exit; } print("<td>"); print("<select name = 'name_mezzanine'>"); if (!$id_mezz) { print("<option value = ''> -- Seleccione Opci&oacute;n -- "); } while ($filamezz = mysql_fetch_array($sino)) { print("<option value = '$filamezz[id_mezz]'>$filamezz[descripcion]"); } print("</select>"); print("</td>"); print("</tr>"); print("<tr>"); print("<td>Estructura Principal<font color = 'red'><b> * </b></font></td>"); $sql = "SELECT id AS id_estruc_princ, descripcion FROM estruc_princ "; $where = " "; $order = "ORDER BY id_estruc_princ "; $estpri = mysql_query($sql. $where. $order, $con); if (!$estpri) { echo "No se puedo efectaur la consulta"; mysql_close($con); exit; } print("<td>"); print("<select name = 'name_estruc_princ'>"); if (!$id_estruc_princ) { print("<option value = ''> -- Seleccione Opci&oacute;n -- "); } while ($filaestpri = mysql_fetch_array($estpri)) { print("<option value = '$filaestpri[id_estruc_princ]'>$filaestpri[descripcion]"); } print("</select>"); print("</td>"); print("</tr>"); print("</table>"); if ($id) { print("<p align = 'center'><input name = 'agregar' type = 'submit' value = 'Agregar'> <input type='button' value='Volver' onClick='history.go(-1);'>"); } ?>
Output for 7.0.0 - 7.1.0
Warning: include(../administracion/conexion.php): failed to open stream: No such file or directory in /in/28TZC on line 2 Warning: include(): Failed opening '../administracion/conexion.php' for inclusion (include_path='.:') in /in/28TZC on line 2 <form action = captura.php method = 'post' name = 'formulario'><table align = 'center'><tr><td align='right' colspan = '2'><font color = 'red'><b>* = Campos obligatorios.</b></font></td></tr><tr bgcolor='#D3DCE3'><td align = 'center' colspan = '2'><b>Estudio Sena</b></td></tr><tr><td>C&oacute;digo<font color = 'red'><b> * </b></font></td> Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/28TZC:57 Stack trace: #0 {main} thrown in /in/28TZC on line 57
Process exited with code 255.
Output for 5.1.0 - 5.6.25
Warning: include(../administracion/conexion.php): failed to open stream: No such file or directory in /in/28TZC on line 2 Warning: include(): Failed opening '../administracion/conexion.php' for inclusion (include_path='.:') in /in/28TZC on line 2 <form action = captura.php method = 'post' name = 'formulario'><table align = 'center'><tr><td align='right' colspan = '2'><font color = 'red'><b>* = Campos obligatorios.</b></font></td></tr><tr bgcolor='#D3DCE3'><td align = 'center' colspan = '2'><b>Estudio Sena</b></td></tr><tr><td>C&oacute;digo<font color = 'red'><b> * </b></font></td> Fatal error: Call to undefined function mysql_query() in /in/28TZC on line 57
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: main(../administracion/conexion.php): failed to open stream: No such file or directory in /in/28TZC on line 2 Warning: main(): Failed opening '../administracion/conexion.php' for inclusion (include_path='.:') in /in/28TZC on line 2 <form action = captura.php method = 'post' name = 'formulario'><table align = 'center'><tr><td align='right' colspan = '2'><font color = 'red'><b>* = Campos obligatorios.</b></font></td></tr><tr bgcolor='#D3DCE3'><td align = 'center' colspan = '2'><b>Estudio Sena</b></td></tr><tr><td>C&oacute;digo<font color = 'red'><b> * </b></font></td> Fatal error: Call to undefined function mysql_query() in /in/28TZC on line 57
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: main(../administracion/conexion.php): failed to open stream: No such file or directory in /in/28TZC on line 2 Warning: main(): Failed opening '../administracion/conexion.php' for inclusion (include_path='.:') in /in/28TZC on line 2 <form action = captura.php method = 'post' name = 'formulario'><table align = 'center'><tr><td align='right' colspan = '2'><font color = 'red'><b>* = Campos obligatorios.</b></font></td></tr><tr bgcolor='#D3DCE3'><td align = 'center' colspan = '2'><b>Estudio Sena</b></td></tr><tr><td>C&oacute;digo<font color = 'red'><b> * </b></font></td> Notice: Undefined variable: con in /in/28TZC on line 57 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /in/28TZC on line 57 No se puedo efectaur la consulta Notice: Undefined variable: con in /in/28TZC on line 59 Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /in/28TZC on line 59
Output for 4.3.0 - 4.3.1
Warning: main(../administracion/conexion.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/28TZC on line 2 Warning: main() [http://www.php.net/function.main]: Failed opening '../administracion/conexion.php' for inclusion (include_path='.:') in /in/28TZC on line 2 <form action = captura.php method = 'post' name = 'formulario'><table align = 'center'><tr><td align='right' colspan = '2'><font color = 'red'><b>* = Campos obligatorios.</b></font></td></tr><tr bgcolor='#D3DCE3'><td align = 'center' colspan = '2'><b>Estudio Sena</b></td></tr><tr><td>C&oacute;digo<font color = 'red'><b> * </b></font></td> Notice: Undefined variable: con in /in/28TZC on line 57 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /in/28TZC on line 57 No se puedo efectaur la consulta Notice: Undefined variable: con in /in/28TZC on line 59 Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /in/28TZC on line 59