como puedo hacerle para que usando un select option me deje impresa el ultimo dato que yo seleccione
Publicado por Haydee (11 intervenciones) el 21/04/2014 23:43:27
Este es mi codigo HTML
------------------------------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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<body>
<h1><?
echo $_GET[a] ;
?>
<br />
<? echo $_GET[j];?>
<br />
<? echo $_GET[h];
?></h1>
<div>
<p><img src="logo_rtc.jpg" width="210" height="100" id="logo"></p>
<p><img src="logo_segob.jpg" width="240" height="79" id="logo2" /></p>
</div>
<form onsubmit=" return comprobar(this)" action="guardar_alerta.php" name="form1" method="get">
<table align="center">
<tr>
<td>
<h1> Televisión</h1>
<p>
<select name="television" id="television" onchange="checa_tv()">
<datalist id="tele">
<?
$rs = db(2);?>
<option value="0">Seleccione un Porgrama</option>
<? while ($row =mysql_fetch_array($rs)){?>
<option value="<? echo $row[id_programa]. $_GET[nom_programa]?>"><? echo $row[nom_programa]?> </option>
<? } ?>
</datalist>
</select>
</p>
<p> </p>
<td>
<h1>Radio</h1>
<p>
<?
$rs = db(1);?>
<select name="radio" id="radio" onchange="checa_r()">
<datalist id="radio">
<option value="0"> Seleccione Programa</option>
<? while ($row =mysql_fetch_array($rs)){?>
<option value="<? echo $row[id_programa] ?>"><? echo $row[nom_programa]?></option>
<? } ?>
</datalist>
</select>
</p>
<p> </p></td>
<tr>
<td>Fecha </td>
<td><input type="text" name="fecha" value="<? echo date("Y-m-d")?>"/></td>
</tr>
<tr>
<td>Hora</td>
<td><input type="text" name="hora" value="<? echo date("h:m:s")?>" onblur="verifica(this)"/></td>
</tr>
<tr>
<td> Onomástico</td>
<td><input type="text" name="ono" required /></td>
</tr>
<tr>
<td> Tema</td>
<td><input type="text" name="tema" required/></td>
</tr>
<tr>
<td>Contexto</td>
<td>
<textarea name="con">
</textarea> </td>
</tr>
</table>
<p> </p>
<p>
<input type="submit" value="Guardar" id="boton"/>
</p>
</form>
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
<?
include "funciones.php";
$conexion= conectar();
if($_GET[radio] == 0){
$u = $_GET[television];
}else
{ $u = $_GET[radio];
}
$sql =" INSERT INTO alertas VALUES('','".$_GET[ono]."','".$_GET[tema]."','".$_GET[con]."','".$_GET[fecha]." ".$_GET[hora]."','".$u."')";
mysql_query($sql, $conexion) or die (mysql_error());
$sql1 = "SELECT nom_programa, id_tipo_medio FROM programas WHERE id_programa=".$u;
$ob = mysql_query($sql1, $conexion) or die (mysql_error());
$b = mysql_fetch_array($ob);
//header('Location: Alerta.php');-->enlace
?>
<script type="text/javascript">
window.location.href = "Alerta.php?a=<? echo $b[nom_programa]?>&h=<? echo $u?>&j=<? echo $b[id_tipo_medio]?>" ;
</script>
Valora esta pregunta
0