Hi guys i am a PHP newbie trying to learn from the beginning. I am reading a php book and i can't get past a particular example because $_GET and $_POST just won't work. Below is the code i am working with:
HTML File
<form action="welcome1.php" method="get">
<div>
<label for="firstname">First name: <input type="text" name"firstname"
id="firstname"/></label>
</div>
<div>
<label for="lastname">
Last name: <input type="text" name="lastname" id="lastname"/>
</label>
</div>
<div>
<input type="submit" value="GO" />
</div>
PHP file
<?php
$firstname = $_GET['firstname'];
$lastname = $_GET['lastname'];
print 'Welcome to our website, ' .
htmlspecialchars($firstname, ENT_QUOTES, 'UTF-8') . ' ' .
htmlspecialchars($lastname, ENT_QUOTES, 'UTF-8') . '!';
?>
I am working on a windows pc with Vista home edition installed. I run a localhost server installed via XAMMP. Please this has been a recurring problem for me. Each time i get to this stage in the past i always get stuck. $_GET and $_POST just does not work for me. Please heeeelp!