Foros del Web » Programando para Internet » PHP »

Notice: Undefined index: campo en F: \ wamp \ www \ creacion \ _admin \ gestionimagen

Estas en el tema de Notice: Undefined index: campo en F: \ wamp \ www \ creacion \ _admin \ gestionimagen en el foro de PHP en Foros del Web. hola buenas Estoy trabajando en una web, a la cual, le estoy creando la administracion, estoy creando un campo para cambiar las imagenes de un ...
  #1 (permalink)  
Antiguo 19/09/2012, 14:43
Avatar de ricky0123456  
Fecha de Ingreso: septiembre-2012
Ubicación: Caracas
Mensajes: 25
Antigüedad: 11 años, 7 meses
Puntos: 0
Pregunta Notice: Undefined index: campo en F: \ wamp \ www \ creacion \ _admin \ gestionimagen

hola buenas

Estoy trabajando en una web, a la cual, le estoy creando la administracion, estoy creando un campo para cambiar las imagenes de un slider y me da este error..
estoy trabajando en localhost

Notice: Undefined index: campo en F: \ wamp \ www \ creacion \ _admin \ gestionimagen.php on line 29 Call Stack # TimeMemoryFunctionLocation 10.0009371888 {main} () .. \ gestionimagen.php : 0 "/>

este es el codigo del onclick flotante

<body>

<?php if ((isset($_POST["enviado"])) && ($_POST["enviado"] == "form1")) {
$nombre_archivo = $_FILES['userfile']['name'];
move_uploaded_file($_FILES['userfile']['tmp_name'],"../documentos/productos".$nombre_archivo);
?>
<script>
opener.document.form1.<?php echo $_POST["nombrecampo"]; ?>.value="<?php echo $nombre_archivo; ?>";
self.close();
</script>
<?php
}
else
{?>

<form action="gestionimagen.php" method="post" enctype= "multipart/form-data" id="form1" name="form1">
<p>
<input name="userfile" type="file" />
</p>
<p>
<input type="submit" name="button" id="button" value="Subir Imagen" />
</p><input name="nombrecampo" type="hidden" value="<?php echo $_GET["campo"]; ?>" />
<input type="hidden" name="enviado" value="forml" />
</form>
<?php }?>
</body>
</html>

el codigo de la pagina de formulario

te adjunto código de donde esta el formulario

<script>
function subirimagen(nombrecampo)
{
self.name = 'opener';
remote = open('gestionimagen.php?campo='+nombrecampo, 'remote', "toolbar=no,menubar=no,directories=no,status=n o,re sizable=yes,location=no,scrollbars=no,height=300,w idth=300,screenX=10,screenY=50")
remote.focus()
}

</script>


<h1>A&ntilde;adir Publicidad</h1>
<p>&nbsp;</p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td width="193" align="right" nowrap="nowrap"><h3>Imagen Grande(734x250 px):</h3></td>
<td width="240"><input type="text" name="strImagenGrande" value="" size="32" />
<input type="button" name="button" id="button" value="Subir imagen" onclick="javascript:subirimagen('strImagenGrande') ;" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> <h3>Imagen Peque&ntilde;a (80x50 px):</h3></td>
<td><input type="text" name="strImagenPequenya" value="" size="32" />
<input type="button" name="button2" id="button2" value="Subir imagen" onclick="javascript:subirimagen('strImagenPequenya ');" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><h3>Titulo:</h3></td>
<td><input type="text" name="strTitulo" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><h3>Sub Titulo:</h3></td>
<td><input type="text" name="strSubTitulo" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><h3>Menu:</h3></td>
<td><input type="text" name="strMenu" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><h3>Link:</h3></td>
<td><input type="text" name="strlink" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><h3>Orden:</h3></td>
<td><input type="text" name="intOrden" value="" size="5" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><h3>Estado:</h3></td>
<td><label for="inStado"></label>
<select name="inStado" id="inStado">
<option value="1">Activado</option>
<option value="o">Desactivado</option>
</select></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><h3>&nbsp;</h3></td>
<td><input type="submit" value="Aceptar" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p>&nbsp;</p>

muchas gracias de antemano
  #2 (permalink)  
Antiguo 19/09/2012, 16:34
Avatar de abimex
Colaborador
 
Fecha de Ingreso: marzo-2007
Ubicación: ~
Mensajes: 751
Antigüedad: 17 años, 1 mes
Puntos: 137
Respuesta: Notice: Undefined index: campo en F: \ wamp \ www \ creacion \ _admin \ ge

<?php echo $_GET["campo"]; ?>
estas llamando a una variable del GET que posiblemente no este definida
osea tendiras que ponerla en la URL
algo.php?campo=daglakjf
  #3 (permalink)  
Antiguo 28/11/2012, 17:50
Avatar de gcbp11  
Fecha de Ingreso: noviembre-2012
Ubicación: México
Mensajes: 4
Antigüedad: 11 años, 5 meses
Puntos: 0
Respuesta: Notice: Undefined index: campo en F: \ wamp \ www \ creacion \ _admin \ ge

Amigo resolvieron el problema? Me esta pasando exactamente lo mismo, me marca el mismo error de Notice: Undefined index:

Etiquetas: formulario, html, index, input, notice, select, undefined, wamp, campos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:16.