problema de novato
Hola, soy nuevo en esto del php, y llevo ya dos dias peleandome y no consigo corregir un par de errors.
el codigo lo he copiado de un manual, y es asi:
<?php
if($envia){
echo('hola');
}
else{
?>
<html>
<head>
<title>php</title>
</head>
<body>
<h1 align="center" class="Estilo1">Pimera plana web php</h1>
<p align="center" class="Estilo1"> </p>
<div align="center">
<br>
<FORM METHOD="post" ACTION="<?=$PHP_SELF?>">
<center><input name="nick" type="text" id="nick" maxlength="10"> nick
<center><input name="password" type="text" id="password" maxlength="15"> password
<p> <center><input name="mail" type="text" id="mail" maxlength="50"></center> e-mail</p>
<input type="submit" name="Enviar" value="envia">
<input type="reset" value="Restablecer" name="B2">
</form>
</br>
</div>
</body>
</html>
<?php
}
?>
los erores que me dan son:
primero se me carga el formulario como deberia ser, pero encima de el me escribe: Undefined index: envia
y el otro e que al darle a enviar me dice:
You don't have permission to access /<br /><b>Notice</b>: Undefined variable: PHP_SELF in <b>c:/archivos de programa/easyphp1-8/www/index.php</b> on line <b>27</b><br /> on this server.
a ver si alguien me puede hechar un cable....
gracias
el codigo lo he copiado de un manual, y es asi:
<?php
if($envia){
echo('hola');
}
else{
?>
<html>
<head>
<title>php</title>
</head>
<body>
<h1 align="center" class="Estilo1">Pimera plana web php</h1>
<p align="center" class="Estilo1"> </p>
<div align="center">
<br>
<FORM METHOD="post" ACTION="<?=$PHP_SELF?>">
<center><input name="nick" type="text" id="nick" maxlength="10"> nick
<center><input name="password" type="text" id="password" maxlength="15"> password
<p> <center><input name="mail" type="text" id="mail" maxlength="50"></center> e-mail</p>
<input type="submit" name="Enviar" value="envia">
<input type="reset" value="Restablecer" name="B2">
</form>
</br>
</div>
</body>
</html>
<?php
}
?>
los erores que me dan son:
primero se me carga el formulario como deberia ser, pero encima de el me escribe: Undefined index: envia
y el otro e que al darle a enviar me dice:
You don't have permission to access /<br /><b>Notice</b>: Undefined variable: PHP_SELF in <b>c:/archivos de programa/easyphp1-8/www/index.php</b> on line <b>27</b><br /> on this server.
a ver si alguien me puede hechar un cable....
gracias
<html>
<head>
<title>php</title>
</head>
<body>
<h1 align="center" class="Estilo1">Pimera plana web php</h1>
<p align="center" class="Estilo1">Â </p>
<div align="center">
<br>
<?php
if($envia){
echo(\'hola\');
}
else{
print "<center><FORM METHOD=post ACTION=$PHP_SELF>
<input name=nick type=text id=nick maxlength=10> nick
<input name=password type=text id=password maxlength=15> password
<p> <center><input name=mail type=text id=mail maxlength=50></center> e-mail</p>
<input type=submit name=Enviar value=envia>
<input type=reset value=Restablecer name=B2>
</form></center>";
}
?>
</br>
</div>
</body>
</html>
<head>
<title>php</title>
</head>
<body>
<h1 align="center" class="Estilo1">Pimera plana web php</h1>
<p align="center" class="Estilo1">Â </p>
<div align="center">
<br>
<?php
if($envia){
echo(\'hola\');
}
else{
print "<center><FORM METHOD=post ACTION=$PHP_SELF>
<input name=nick type=text id=nick maxlength=10> nick
<input name=password type=text id=password maxlength=15> password
<p> <center><input name=mail type=text id=mail maxlength=50></center> e-mail</p>
<input type=submit name=Enviar value=envia>
<input type=reset value=Restablecer name=B2>
</form></center>";
}
?>
</br>
</div>
</body>
</html>