-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformulario.php
34 lines (30 loc) · 1.14 KB
/
formulario.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
include 'conexion.php';
include "DB.php";
$form = "";
$database = $_POST['database'];
$tabla = $_POST['tabla'];
//$database = "Autoescuela";
//$tabla = "alumno";
$sql = "select * from `information_schema`.`COLUMNS` where `TABLE_SCHEMA`='".$database."' AND table_name = '".$tabla."'";
$form.= "<pre>";
$form.="<html>
<head>
<title>Formulario de ".$tabla."</title>
</head>
<body>
<form id=\"insertar".$tabla."\" action=\"control.php\" method=\"POST\"><br>";
$form.=" <table align =\"center\">";
$q = DB::get()->query($sql);
foreach ($q as $resultado){
$form.= "<br> <tr><td>".$resultado[3]."</td><td> <input type=\"text\" name=".$resultado[3]."></td></tr>";
}
$form.="<br><br> <tr><td align =\"center\" colspan=\"2\"><input type=\"submit\" value=\"Enviar\"> <br> <input type=\"reset\" value=\"Cancelar\"></td></tr>
</table>
</form>
</body>
</html>";
$form .= "</pre>";
echo $form;
//echo $insert;
?>