Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/05/2015, 18:49
ciscojuan
 
Fecha de Ingreso: mayo-2015
Mensajes: 1
Antigüedad: 9 años
Puntos: 0
Pregunta registro de ofertas

Buenas noches,
estoy haciendo un proyecto de servicios para clientes, hice un formulario html que redireciona a insertar. php con los repectivos datos. a la hora de probar me sale " undefined index nombre" por lo que busque en internet, revise nombres de variables, ect. pero nada.
Posteo los dos archivos por si alguien me echa una mano,
gracias de antemanop.

form html

<form name="formaServicio" action="../edu.marketplace.registros/registroservicioindividual.php" method="POST" enctype="multipart/form-data">
<center>
<table>

<tr>
<td>Nombre</td><td><input type="text" name="nombre" value="" /></td>
</tr>
<tr>
<td>Valor</td>
<td><input type="text" name="valor" value="" /></td>
</tr>
<tr>
<td>FechaPublicacion</td>
<td>
<input type="date" name="fecha_publicado" value="" style="width: 151px" /></td>
</tr>
<tr>
<td>Categoria</td>
<td> <select name="categoria" style="width: 170px">
<option value="">Seleccionar</option>
<option value="Alojamiento">Alojamiento</option>
<option value="Paseos">Paseos</option>
<option value="Alimentacion">Alimentacion</option>
</select></td>
</tr>


</table>

<input type="submit" value="Ingresar" name="Publicar" style="width: 68px" />
<button type="button" name="buscarServicio" onclick="window.location.href='BuscarServicio.php' " class="auto-style1" style="width: 189px"><img alt="icono" src="../img/Search.png"/>Buscar Servicios</button>
</center>
</form>

archivo insertar.php

<?php

include("../conexion.php");
$link=Conectarse();
if($_REQUEST['nombre'] !=null && $_REQUEST['valor'] !=null && $_REQUEST['fecha_publicado'] !=null && $_REQUEST['categoria'] !=null){

$nombre = $_REQUEST['nombre'];
$valor = $_REQUEST['valor'];
$fechapublicacion= $_REQUEST['fecha_publicado'];
$valor = $_REQUEST['categoria'];

$con=("INSERT INTO ofertas (nombre,valor,fecha_publicado,categoria) VALUES ('$nombre','$valor','$fechapublicacion','$categori a')");
mysql_query($con);

echo "<script type='text/javascript'> alert('oferta registrada correctamente');
window.location='../proveedores/rgistroservicioindividual.html'
</script>";
}
?>