Comunidad de diseño web y desarrollo en internet online

$HTTP_POST_VARS+php

Citar            
MensajeEscrito el 19 May 2006 11:44 pm
tengo un problema cheken esta web www.pullmanhoteltrujillo.com/contactenos1.php

aqui ta maso menos su codigo:
saben quiero q al enviar un formulario salga gracias por enviar pero solo en esa parte (el div quiero decir no en los dos )y ademas q se muestren los formualrios q no se oculten son dos formularios como puedo hacer



<div id="content">
<div class="feature">
<?
$i=$HTTP_POST_VARS;
if(!$i)
{
?>
<table width="272" border="0" cellpadding="0" cellspacing="0" bordercolor="#3300FF">
<form name="form2" method="post" action="contactenos1.php">
<tr>
<td width="108"><h3>Contacts</h3></td>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td><h3>Name </h3></td>
<td colspan="3"><input name="name" type="text" id="name" style=" width:167px; height:18px ;border-width:1px ;background-color:#ffffff; border-color:#737373; border-style:solid; margin-left:2px; margin-right:10px; font-family:Tahoma; font-size:11px; color:#666666" value="&nbsp;&nbsp;Enter keyword" size="70"></td>
</tr>
<tr>
<td><h3>Address </h3></td>
<td colspan="3"><input name="address" type="text" id="address" style=" width:167px; height:18px ;border-width:1px ;background-color:#ffffff; border-color:#737373; border-style:solid; margin-left:2px; margin-right:10px; font-family:Tahoma; font-size:11px; color:#666666" value="&nbsp;&nbsp;Enter keyword"></td>
</tr>
<tr>
<td><h3>Phone </h3></td>
<td colspan="3"><input name="phone" type="text" id="phone" style=" width:167px; height:18px ;border-width:1px ;background-color:#ffffff; border-color:#737373; border-style:solid; margin-left:2px; margin-right:10px; font-family:Tahoma; font-size:11px; color:#666666" value="&nbsp;&nbsp;Enter keyword"></td>
</tr>
<tr>
<td><h3>Num of Adults:</h3></td>
<td width="58"><h3>
<select name="adult" class="div" id="adult" style=" width:48px; height:18px " onChange="MM_jumpMenu('parent',this,0)">
<option>01</option>
<option>unnamed2</option>
</select>
</h3></td>
<td width="48"><h3>Children</h3></td>
<td width="58"><select name="children" class="div" id="children" style=" width:48px; height:18px " onChange="MM_jumpMenu('parent',this,0)">
<option>01</option>
<option>unnamed2</option>
</select></td>
</tr>
<tr>
<td><h3>Arrival Date:</h3></td>
<td><select name="arrival_d" class="div" id="arrival_d" style=" width:48px; height:18px " onChange="MM_jumpMenu('parent',this,0)">
<option>01</option>
<option>unnamed2</option>
</select></td>
<td><select name="arrival_m" class="div" id="arrival_m" style=" width:48px; height:18px " onChange="MM_jumpMenu('parent',this,0)">
<option>01</option>
<option>unnamed2</option>
</select></td>
<td><select name="arrival_a" class="div" id="arrival_a" style=" width:48px; height:18px " onChange="MM_jumpMenu('parent',this,0)">
<option>01</option>
<option>unnamed2</option>
</select></td>
</tr>
<tr>
<td><h3>Departure:</h3></td>
<td><select name="d_d" class="div" id="d_d" style=" width:48px; height:18px " onChange="MM_jumpMenu('parent',this,0)">
<option>01</option>
<option>unnamed2</option>
</select></td>
<td><select name="d_m" class="div" id="d_m" style=" width:48px; height:18px " onChange="MM_jumpMenu('parent',this,0)">
<option>01</option>
<option>unnamed2</option>
</select></td>
<td><select name="d_a" class="div" id="d_a" style=" width:48px; height:18px " onChange="MM_jumpMenu('parent',this,0)">
<option>01</option>
<option>unnamed2</option>
</select></td>
</tr>
<tr>
<td><h3>Comment</h3></td>
<td colspan="3"><span style=" margin-top:3px ">
<textarea name="textarea" style=" width:178px; height:55px ;border-width:1px ;background-color:#ffffff; border-color:#898989; border-style:solid; margin-left:2px; margin-right:10px; font-family:Tahoma; font-size:11px; color:#666666; overflow:auto"></textarea>
</span></td>
</tr>
<tr>
<td colspan="4"> <a class="enlace" href="#" onClick="document.forms.form2.submit();return false">

<img src="imagenes/3_b2.jpg" alt="reseterar" width="55" height="18" border="0"></a><a class="enlace" href="#" onClick="document.forms.form2.submit();return false"><img src="imagenes/3_b1.jpg" alt="reseterar" width="55" height="18" border="0"></a></td>
</tr>
</form>
</table>

<?
}
switch ($i)
{
case 1:
$band=1;
//Estoy recibiendo el formulario, compongo el cuerpo
$cuerpo = "Formulario enviado\n";
$cuerpo .= "In1: " . $HTTP_POST_VARS["in1"] . "\n";
$cuerpo .= "In2: " . $HTTP_POST_VARS["in2"] . "\n";
$cuerpo .= "Out1: " . $HTTP_POST_VARS["out1"] . "\n";
$cuerpo .= "Out2: " . $HTTP_POST_VARS["out2"] . "\n";
$cuerpo .= "persons: " . $HTTP_POST_VARS["persons"] . "\n";
$cuerpo .= "rooms: " . $HTTP_POST_VARS["rooms"] . "\n";
$cuerpo .= "nombre: " . $HTTP_POST_VARS["nombre"] . "\n";
$cuerpo .= "mail: " . $HTTP_POST_VARS["mail"] . "\n";
//mando el correo...
mail("[email protected]","Formulario recibido",$cuerpo);

//doy las gracias por el env&iacute;o
echo "<center>Gracias por rellenar el formulario. Se ha enviado correctamente.</center>";
//return(0);
break;
?>
</div>
<!-- <div class="story"><img src="imagenes/pre_habitacion.jpg" alt="" width="145" height="96">
<h3>&nbsp;</h3>
</div> -->
</div>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="reservas" -->

<div id="navBar">
<div class="feature">

<table width="173" border="0" cellpadding="0" cellspacing="0" bordercolor="#3300FF">
<form name="form1" method="post" action="../contactenos1.php">
<tr>
<td colspan="2"><h3>Reservation information:</h3></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2"><h3>Check in </h3></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><select name="in1" onChange="MM_jumpMenu('parent',this,0)" style=" width:48px; height:18px " class="div">
<option>30</option>
<option>unnamed2</option>
</select></td>
<td><select name="in2" onChange="MM_jumpMenu('parent',this,0)" style=" width:102px; height:18px " class="div">
<option> April 2005</option>
<option>unnamed2</option>
</select></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2"><h3>Check out </h3></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><select name="out1" onChange="MM_jumpMenu('parent',this,0)" style=" width:48px; height:18px " class="div">
<option>01</option>
<option>unnamed2</option>
</select></td>
<td><select name="out2" onChange="MM_jumpMenu('parent',this,0)" style=" width:102px; height:18px " class="div">
<option> April 2005</option>
<option>unnamed2</option>
</select></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3"><table width="170" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="61"><h3>Persons </h3></td>
<td width="31"><input name="persons" type="text" style=" width:22; height:18px ;border-width:1px ;background-color:#ffffff; border-color:#898989; border-style:solid; margin-left:2px; margin-right:10px; font-family:Tahoma; font-size:11px; color:#666666" value="&nbsp;&nbsp;1" size="2"></td>
<td width="54"><h3>Rooms</h3></td>
<td width="24"><input name="rooms" type="text" style=" width:22; height:18px ;border-width:1px ;background-color:#ffffff; border-color:#898989; border-style:solid; margin-left:2px; margin-right:10px; font-family:Tahoma; font-size:11px; color:#666666" value="&nbsp;&nbsp;1" size="2"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><h3>Nombre</h3></td>
<td colspan="3"><input name="nombre" type="text" style=" width:103px; height:18px ;border-width:1px ;background-color:#ffffff; border-color:#737373; border-style:solid; margin-left:2px; margin-right:10px; font-family:Tahoma; font-size:11px; color:#666666" value="&nbsp;&nbsp;Enter keyword"> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td><h3>E-mail</h3></td>
<td colspan="3"><input name="mail" type="text" style=" width:103px; height:18px ;border-width:1px ;background-color:#ffffff; border-color:#737373; border-style:solid; margin-left:2px; margin-right:10px; font-family:Tahoma; font-size:11px; color:#666666" value="&nbsp;&nbsp;Enter keyword"> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"><!--<input type="submit" name="Submit" value="Enviar" class="enviar_btn">-->
<!--<input type="submit" name="Submit" value="Enviar">-->
<!--<a href="javascript:document.frm.submit();"><img src="imagenes/but1.jpg" width="121" height="18" border="0"></a>-->
<!--<style type="text/css">
.enlace{cursor:default;}
</style>-->
<a class="enlace" href="#" onClick="document.forms.form1.submit();return false"><img src="imagenes/but1.jpg" width="120" height="18" border="0" alt="enviar"></a></td>
</tr>
</form>
</table>
<?

case 2:
$band=1;
echo "<center>Entro al segundo.</center>";
//Estoy recibiendo el formulario, compongo el cuerpo
$cuerpo = "Formulario enviado\n";
$cuerpo .= "In1: " . $HTTP_POST_VARS["in1"] . "\n";
$cuerpo .= "In2: " . $HTTP_POST_VARS["in2"] . "\n";
$cuerpo .= "Out1: " . $HTTP_POST_VARS["out1"] . "\n";
$cuerpo .= "Out2: " . $HTTP_POST_VARS["out2"] . "\n";
$cuerpo .= "persons: " . $HTTP_POST_VARS["persons"] . "\n";
$cuerpo .= "rooms: " . $HTTP_POST_VARS["rooms"] . "\n";
$cuerpo .= "nombre: " . $HTTP_POST_VARS["nombre"] . "\n";
$cuerpo .= "mail: " . $HTTP_POST_VARS["mail"] . "\n";
//mando el correo...
mail("[email protected]","Formulario recibido",$cuerpo);

//doy las gracias por el env&iacute;o
echo "<center>Gracias por rellenar el formulario. Se ha enviado correctamente.</center>";
//return(0);
break;
}
?>

</div>
<!--<div class="relatedLinks">
<h3>Related Link Category</h3>
<ul>
<li><a href="#">Related Link</a></li>
<li><a href="#">Related Link</a></li>
</ul>
</div>-->
</div>

Por juan_gv

108 de clabLevel



 

firefox
Citar            
MensajeEscrito el 23 May 2006 02:59 am
este...... q???

:S :S :S

Por 3w

145 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 23 May 2006 11:07 pm
Demasiado código para revisar. Pero la mejor opción (si sólo quieres actualizar ese div) es AJAX. Este es un excelente tutorial.

Éxito!

P.D. Sino, pues separa los formularios y evalúa si está enviado el submit 1 o el 2. En cada caso, separa las respuestas.

Por Pedro

BOFH

3017 de clabLevel

3 tutoriales
6 articulos

  Bastard Operators From Hell

Honduras

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.