Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/05/2005, 04:48
lochino006
 
Fecha de Ingreso: abril-2005
Mensajes: 93
Antigüedad: 19 años
Puntos: 0
Este es el codigo que tengo lo que hago es al clickar el boto se ejecuta el codigo php que introduce y actualiza unos datos y quiero que en terminar me redireccione a la pagina confirmacions.html
Codigo:
<html>
<head><title>assignar stand</title></head>
<body>
<form method="GET">

<h1><center><b>Assignar stand a un expositor</b></center></h1>

<table border="0" cellpadding="3" cellspacing="0">
<tr valign="top">
<td> <b>CIF expositor:</b> </td>
<td><input name="cif" type="text" size=10></td>
</tr>
<tr>
<td><b>NPAB</b></td>
<td><select name="npab" id="evento">

<?php
$d=mysql_connect("localhost","root");
mysql_select_db("Xarxes", $d);
$l = mysql_query("SELECT s.NPAB FROM stands s where s.OCUPAT=0");
while ($row2=mysql_fetch_object($l)){
print "<option value=$row2->NPAB>$row2->NPAB</option>";
}
?>
</selected>
</td>

</tr>

<tr valign="top">
<td> <b>NOM:</b> </td>
<td><input name="nom" type="text" size=10></td>
</tr>

<tr valign="top">
<td> <b>DIRECCIO:</b> </td>
<td><input name="direccio" type="text" size=30></td>
</tr>

<tr valign="top">
<td> <b>PROVINCIA:</b> </td>
<td><input name="provincia" type="text" size=10></td>
</tr>

<tr valign="top">
<td> <b>CODIPOSTAL:</b> </td>
<td><input name="cp" type="text" size=10></td>
</tr>



<tr valign="top">

<td>&nbsp; </td>
<td>
<input type="submit" value="ACCEPTAR" name="ENVIAR" <="window.location= 'confirmacions.html';">

</td>
</tr>

<?php


if($ENVIAR){

$d=mysql_connect("localhost","root");
mysql_select_db("Xarxes", $d);


$a = mysql_query("SELECT e.CIF FROM expositors e WHERE e.CIF=$cif ", $d);
if($row=mysql_fetch_array($a)){
$sql = mysql_query("UPDATE stands SET OCUPAT=1 WHERE NPAB=$npab",$d);
$sql1=mysql_query("UPDATE stands SET CIF=$cif WHERE NPAB=$npab",$d);

}

else{

$sql=mysql_query("INSERT INTO expositors(CIF,NOM,DIRECCIO,PROVINCIA,CODIPOSTAL)V ALUES('$cif','$nom','$direccio','$provincia','$cp' )",$d);
$sql = mysql_query("UPDATE stands SET OCUPAT=1 where NPAB=$npab ",$d);
$sql1=mysql_query("UPDATE stands SET CIF=$cif where NPAB=$npab" ,$d);

}
}

?>


</table>
</form>

<CENTER><A HREF="inicio.html">TORNAR A INICI</A></CENTER>

</body>
</html>