
urgente validar formulario
Publicado por c3po_081 (14 intervenciones) el 16/07/2015 05:18:11
Estimados.
Tengo el siguiente problema, tengo que validar un formulario y me salta un error al cual no lo puedo solucionar. me podran dar una mano
Este es el error que sale: "Fatal error: Cannot use isset() on the result of a function call (you can use "null !== func()" instead) in C:\xampp\htdocs\fundacion_cine_con_vecinos\lib\concurso.php on line 25"
y este es el codigo de la validacion ***(enviado.php)***
Gracias. ;)
Tengo el siguiente problema, tengo que validar un formulario y me salta un error al cual no lo puedo solucionar. me podran dar una mano
Este es el error que sale: "Fatal error: Cannot use isset() on the result of a function call (you can use "null !== func()" instead) in C:\xampp\htdocs\fundacion_cine_con_vecinos\lib\concurso.php on line 25"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
*** codigo del <form>****(esto va con un inclide en otro orchivo )
<?php
session_start();
?>
<script language="JavaScript">
function maximaLongitud(texto,maxlong) {
var tecla, in_value, out_value;
if (texto.value.length > maxlong) {
in_value = texto.value;
out_value = in_value.substring(0,maxlong);
texto.value = out_value;
return false;
}
return true;
}
</script>
>
<form name="formulario" method="POST" action="enviado.php">
<label>TIULO</label>
<input name="titulo" text="text" id="titulo"/>
<?php
if (!isset($_SESSION('error1'))) {
echo "<font color='red'>".$_SESSION('error1')"</font>";
} else {
echo "";
}
unset($_SESSION('error1'));
?>
<label>DIRECTOR</label>
<input type="text" name="director">
<label>AÑO</label>
<input type="text" name="year">
<label>DURACION</label>
<input type="text" name="duracion">
<label for="text">Mensaje (hasta 250 caracteres, tres lineas)</label>
<textarea name="mensaje" cols="50" rows="5" onKeyUp="return maximaLongitud(this,254)"></textarea>
<label>EMAIL</label>
<input type="text" name="mail">
<label>TELEFONO</label>
<input type="text" name="tel">
<input type="submit" class="bot"><input type="reset" class="bot">
</form>
y este es el codigo de la validacion ***(enviado.php)***
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
session_start();
$titulo= $_POST["titulo"];
$director= $_POST["director"];
$year= $_POST["year"];
$duracion= $_POST["duracion"];
$mensaje= $_POST["mensaje"];
$mail= $_POST["mail"];
$tel= $_POST["tel"];
if ($titulo=="") {
$_SESSION ['error1']="Debe colocar el titulo del film"
}
if ($director=="") {
$_SESSION ["error2"]="Debe colocar el nombre del director"
}
if ($year=="") {
$_SESSION ["error3"]="Debe colocar el año del film"
}
if ($duracion=="") {
$_SESSION ["error4"]="Debe colocar tiempo de duracion del film"
}
if ($mensaje=="") {
$_SESSION ["error5"]="Debe colocar descripcion del film"
}
if ($mail=="") {
$_SESSION ["error6"]="Debe colocar un correo electronico de contacto"
}
if ($tel=="") {
$_SESSION ["error7"]="Debe colocar el tel del film"
}
header("location:concurso.php");
?>
Gracias. ;)
Valora esta pregunta


0