This code doesn’t seem to work. When i display html page nothing is echoed out from php. Please help.
<?php
if (isset ($_POST ['First Name']) &&
isset($_POST ['Last Name']) &&
isset ($_POST ['Email_address']) &&
isset ($_POST ['Username']) &&
isset ($_POST['Password'])) {
$fname = $_POST['First Name'];
$lname = $_POST['Last Name'];
$email = $_POST['Email address'];
$username = $_POST['Username'];
$password = $_POST['Password'];
if (!empty ($fname) && !empty ($lname) && !empty ($email) && !empty ($username) && !empty ($password)) {
echo 'ok';
}else{
echo 'all fields are required';
}
}
?>
This is html
<fieldset>
<h1>Please register your details here</h1>
<div>
First Name: <input type="text" name="First Name"/><br/>
Last Name: <input type="text" name="Last Name" /><br />
<label for="ea">Email address:</label><input type="text" name="Email address"/><br>
Username:<input type="text" name="Username"/><br
<label for="pw">Password:</label><input type="password"name="passwd"id="pw"size="20" />
<input type="submit" name="submit" value="Submit" />
</div>
</fieldset>
</form>
</form>