Hola estoy haciendo un formulario y al ejecutarlo de mi PC me sale un error, PHP Notice: Undefined variable: HTTP_GET_VARS in C:\Inetpub\wwwroot\contactar\index.php on line 17 y la liena 17 es:
if ($HTTP_GET_VARS["accion"] == "")
Tambien os dejo el código para verlo mejor
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0" class="subcategoryWeb">
<tr>
<td>- Contactar - </td>
</tr>
</table>
<p> </p>
<?php
if ($HTTP_GET_VARS["accion"] == "") {
?>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="159"><table width="159" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table></td>
<td width="595">
<table width="75%" border="1" cellpadding="0" cellspacing="0" bordercolor="#2D2D2D">
<tr>
<td><form action="index.php?accion=enviar" method="post" name="contacto">
<table width="75%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="table2">Tu nombre: </td>
<td><input name="name" type="text" id="name" class="table" /></td>
</tr>
<tr>
<td class="table2">Tu email:</td>
<td><input name="email" type="text" id="email" class="table" /></td>
</tr>
<tr>
<td class="table2">Tu asunto: </td>
<td><label>
<select name="asunto" class="table" id="asunto">
<option>- Seleccionar Opcio -</option>
<option>Sugerencia</option>
<option selected="selected">Colaborar</option>
</select>
</label></td>
</tr>
<tr>
<td class="table2">Tu comentario: </td>
<td><textarea name="com" rows="5" class="table" id="com"></textarea></td>
</tr>
</table>
<p align="center">
<input type="submit" name="Submit" value="enviar" />
</p>
</form></td>
</tr>
</table>
</td>
</tr>
</table>
<p> </p>
<?php
}else{
if ($HTTP_GET_VARS["accion"] == "enviar"){
$email = $HTTP_POST_VARS["email"];
$nombre = $HTTP_POST_VARS["nombre"];
$com = $HTTP_POST_VARS["com"];
if($email == "" || $com== ""){
echo'Rellena los campos vacios.<a href=javascript:history.go(-1)>Atrás</a>';
}else{
$to = "zak@hotmail.com";
$subject = "Contactar";
$msg="Hola tienes un formulario enviado:\nSu nombre: " .$name. " \n Su e-mail: " .$email ." \n Su descripción: ". $com . ".";
mail($to, $subject, $msg);
echo'mensaje enviado correctamente';
}
}
}
?>