PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
using textarea as input in php function Posted by sduke789 on 21 Apr 2012 at 5:00 PM
So I have an html form

<form action="mail2.php" method="post" enctype="text/plain">
Name:<input type="text" name="name"/><br/>
Email:<input type="text" name="email"/><br/>
Comments:<br/><textarea name="comments" rows="10" cols="50"></textarea><br/>
<br/><br/>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>

I just wanted to use the contents of the textarea but I can't seem to get the php function to even print them. Currently I have a simple function

<?
$comments=$_POST['comments'];
$comments=str_replace("\r\n", "<br />", $comments);
echo $comments;
echo $_POST['comments'];
?>



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.