PHP Forms code displayed back in the form elements
Posted: Fri Aug 29, 2008 8:50 am
Hi
I am getting the code displayed back in the text boxes on the form i created. When i work the same code in windows its not showing but when working in Linux it showing whts the reason
Form
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------
PHP Script
-----------------------------------------------------------------------------
--------------------------------------------------------------------------
Also, the if (!isset($_REQUEST['email']))
this is not working even if the email field is left blank. Can someone help me with both these
Thanks
Venu
I am getting the code displayed back in the text boxes on the form i created. When i work the same code in windows its not showing but when working in Linux it showing whts the reason
Form
-----------------------------------------------------------------------------------------
Code: Select all
<html>
<head>
<title>Feedback Form </title>
</head>
<body OnLoad="document.forms.frmFeedback.email.focus()">
<table width="396" align="center" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#ffffff">
<tr>
<td>
<fieldset>
<legend><font color="blue">Feedback Form</font></legend>
<table width="389" align="center" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#ffffff">
<form name="frmFeedback" action="sendMail.php" method="post">
<tr>
<td colspan=2>E-Mail:</td>
<td><input name="email" type="text" size="30" maxlength="25" tabindex="1" value="<?php echo $_POST['email']?>">
</td>
</tr>
<tr>
<td colspan=2>Message:</td>
<td>
<textarea name="message" rows="8" cols="40" tabindex="2"><?php echo $_POST['message']?>
</textarea>
</td>
</tr>
<tr>
<td>
<input type="Button" name="cmdSub" Value="Submit" tabindex="3" onClick="submit()">
</td>
<td> <input type="Button" name="cmdRes" Value="Reset" tabindex="3" onClick="reset()">
</td>
</tr>
</form>
</table>
</fieldset>
</td>
</tr>
</table>
</body>
</html>PHP Script
-----------------------------------------------------------------------------
Code: Select all
<?php
$email = $_REQUEST['email'];
$message = $_REQUEST['message'];
echo $email;
echo $message;
//echo "<hr>";
if (!isset($_REQUEST['email']))
{
echo "You have not entered the email id";
//header("Location:http://localhost/examples/FeedbackForm.php");
}
else if (empty($email) || empty($message))
{
echo "You have left one or more than one field blank";
//header("Location:http://localhost/examples/error.php");
}
else
{
header("Location: http://localhost/examples/thankyou.php");
}
?>Also, the if (!isset($_REQUEST['email']))
this is not working even if the email field is left blank. Can someone help me with both these
Thanks
Venu