which function to use to read data from a text area?
Posted: Sun Feb 22, 2004 12:54 pm
this is my php file
I am just wondering why my doesnot give any output? It is aparent that $msg contains no data. why is that ? is this becuase it is reading text from a text area and not from a text field? is there any function other than $_POST to read data from a text area?
Code: Select all
<?php
<html>
<body>
<?php
if(isset($_POST['submit'])){
$to=$_POST['to'];
$sub=$_POST['sub'];
$msg=$POST['msg'];
echo "you want to send email to : "."$to<br>";
echo "your email subject is : "."$sub<br>";
echo "your message is "."$msg";
}else{
?>
<form method="POST" action="<?php echo $PHP_SELF?>">
<table border="0" width="100%">
<tr>
<td width="11%" align="right"><b>To</b></td>
<td width="89%"><input type="text" name="to" size="20"></td>
</tr>
<tr>
<td width="11%" align="right"><b>Subject</b></td>
<td width="89%"><input type="text" name="sub" size="20"></td>
</tr>
<tr>
<td width="11%" align="right"><b>Message</b></td>
<td width="89%"><textarea rows="2" name="msg" cols="20"></textarea></td>
</tr>
</table>
<p align="left"><input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="reset"></p>
</form>
<?php
}
?>
</body>
</html>
?>Code: Select all
echo "$msg"