action php code not invoked
Posted: Sun Sep 13, 2009 1:20 pm
I am trying to learn php.
Now consider the following code. (file name is jobapp.php)
Now consider the following code.(file name is jobapp_action.php)
According 2 me, everything is fine. But why the 2nd php code is not invoked ????
Now consider the following code. (file name is jobapp.php)
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
require("common.php");
?>
<h1><?php echo(COMPANY); ?> Job Application</h1>
<p>Are you looking to get <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> ??"</p>
<form name="frmJobApp" method="post" action="jobapp_action.php">
Please enter ur name :
<input name="applicant" type="text" /><br />
Please enter ur telephone number :
<input name="phone" type="text" /><br />
Please enter ur e-mail id :
<input name="email" type="text" /><br />
Please select the type of position in which you are interested :
<select name="position">
<option value="a">Accounting</option>
<option value="h">Human resource</option>
<option value="m">Management</option>
<option value="s">Sales</option>
</select><br />
Please select the country in which you would like to work :
<select name="country">
<option value="ca">Canada</option>
<option value="cr">Costa Rica</option>
<option value="uk">United Kingdom</option>
<option value="ge">Germany</option>
<option value="us">United States</option>
</select><br />
<input name="avail" type="checkbox" />Available immediately <br />
<input name="enter" type="submit" value="Enter" />
</form>
</body>
</html>Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
require("common.php");
echo("<B>You have submitted the following </b>"
NL . NL .
"NAME : $applicant" . NL .
"PHONE : $phone" . NL .
"E-MAIL : $email" .NL);
$avail = isset($avail);
echo ("Available immediately : " . ($avail ? "yes" : "no"));
?>
</body>
</html>