Buenas, vereis, tengo un problema y es que cree un formulario con INNERHTML con un input dentro de una funcion javascript y ese formulario apunta a un archivo php.
El problema es que me da un error dificil de solventar, ya que dreamweaver no me dice que es un error de sintaxis, pero sin embargo, el parse error de php me dice que hay un error, que es el siguiente:
We selected 'Europe/Paris' for '1.0/no DST' instead in C:\Web\sesion.php
on line 60 Notice: Undefined index: insertardeportes in C:\Web\sesion.php on line 60 Warning: main(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead in C:\Web\sesion.php on
line 62 Fatal error: Call to undefined function alert() in C:\Web\sesion.php on
line 62
Parte del codigo php:
insertardeportes es la id del input
Código PHP:
Ver originalecho '<div align="right">';
echo "Este es el menu del usuario ". $_SESSION['nombre'] ."<br />\n";
echo 'Que quieres hacer?<br>
<strong><div id="capainsertar" style="cursor:pointer;" onClick="muestraformularioinsertar()">Insertar datos</div></strong>';
if ($_REQUEST['insertardeportes'] == "") //LINEA 60
{
alert("No has insertado nada en el campo deporte"); //LINEA 62
}
echo '</div>';
Parte del codigo javascript
:
Código Javascript
:
Ver originalfunction muestraformularioinsertar()
{
if (document.getElementById("capainsertar").innerHTML.length == 14)
{
document.getElementById("capainsertar").innerHTML = "<FORM action=\"sesion.php\" id=\"insertardeportes\" onSubmit=\"borrarcapa(\"capainsertar\");\" >Dime el nombre de tu deporte favorito: <input type=\"text\" id=\"deporte\">   <input type=\"submit\"> </FORM>";
}
}
function borrarcapa(capa)
{
document.getElementById(capa).innerHTML = "";
}
Saludos.