Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Form Posting

$
0
0

I've been trying to work on a form in PHP. I've got it all set up and submitting but the only problem is that I try to display the data back on the page for testing purposes but every time I hit submit, it empties the form with no results. I've written my code as follows:

<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="styling.css">
</head>
<body>
<form action="registerplayer.php" action="POST">
<p>First Name:<input type='text' name='firstName'></p>
<p>Last Name:<input type='text' name='lastName'></p>
<p>Username:<input type='text' name='username'></p>
<p>Password:<input type='text' name='password'></p>
<p><input type='submit' value='Submit'></p>
</form>
<?php
if(isset($_POST["firttName"]) && isset($_POST["lastName"]) && isset($_POST["username"]) && isset($_POST["password"]))
{
$firstname = $_POST["firstName"];
$lastname = $_POST["lastName"];
$username = $_POST["username"];
$password = $_POST["password"];
echo "<p>Name: " . $firstname . " " . $lastname . "\nUsername: " . $username . "\nPassword: " . $password . "</p>";

}
?>
</body></html>

Anyone know what I'm not seeing here? I've been working on this for a while now.


Viewing all articles
Browse latest Browse all 13200

Trending Articles