greetings!
I have a .html file which goes like this:
[code]
//step.html
<html><body>
<h2>Get started!</h2>
I want to log in
<input type=”radio” checked=”checked” name=”Type” value=”Login”>
<br>
I want to register with the following
<input type=”radio” name=”Type” value=”Register”>
</form>
<form action=”session.php” method=”post”>
username: <input name=”user” type=”text”/><br>
and password: <input name=”password” type=”password”/>
<input type=”submit” value=”submit”/></form>
</html></body>
and a php file that handles the user name and password very well. it does what it has to do with them. The problem comes when handling the radiobuttons value, it seems like it does not get anything from it:
[code]//session.php
<html><body>
<?php
$user = $_POST[“usuario”];
$pass = $_POST[“password”];
$login = $user . $pass . “.txt”;
$accion = $_POST[‘Type’];
if (file_exists($login))
{
echo “<html><head><META HTTP-EQUIV=”Refresh” CONTENT=”5;URL=mostrar.php?login=$login”></head><body>User found. logging in”;
echo “<br>$login</body></html>”;
}
else
{
echo “<html><head><META HTTP-EQUIV=”Refresh” CONTENT=”5;URL=step.html”></head>”;
echo “<body>User not found, try again<br>$login<br>$user<br>$pass<br>$accion</body></html>”;
}
?>
</html></body>
The intended purpose for the radiobuttons is that if the user selects Register then instead of logging in, the session.php attemps to create a new account. On the other hand is the user selected Login then session.php will attemp to open up the user’s account.
I set the $accion variable to get the radiobutton value from the $_POST but when the page displays the variables it is empty. I tried using different apostrophes on it but the result is the same. What am I doing wrong??
Thanks! ?