Reply
Old 05-21-2008, 03:05 PM PHP Text-Area Help
Novice Talker

Posts: 11
Name: Hamza
Trades: 0
Hey guys... Needed some help in PHP ..

Basically.. say.. I have 2 or more input fields and one text area.

Now, I want some sort of a php script that would use POST to extract submitted data from the inputfield1, inputfield2, and text-area.

The textarea is going to have numbers in each line .. say like..

123
133
124 .. etc

... Next.. is it possible to extract the information submitted above (field1, field2, and textarea) and form them in some sort of output box as such

field1 textarea field2

So.. say .. output would be something like:

field1 = username
textarea = serial number
field2 = command

result would be
sam 123 accept
dave 133 accept
nick 124 deny

etc etc

Is it possible?

lifetalk is offline
Reply With Quote
View Public Profile Visit lifetalk's homepage!
 
 
When You Register, These Ads Go Away!
Old 05-21-2008, 07:31 PM Re: PHP Text-Area Help
PeachyJuice's Avatar
Super Talker

Posts: 116
Name: Michele T.
Location: Ny, Ny
Trades: 1
Of course that's possible. You just need to name the input boxes and textareas what you'd like. So you'd have...
HTML Code:
<form action="dosomething.php" method="post">
Username: <input type="text" name="username" /><br />
Serial Number:<br />
<textarea name="serialnubmer"></textarea><br />
Command: <input type="text" name="command" />
</form>
And then on the dosomething.php page you just read the $_POST value for each like so...
PHP Code:
$username=addslashes($_POST['username']);
$serialnumber=addslashes($_POST['serialnumber']);
$command=addslashes($_POST['command']); 
Then you can put into databases and such, but I'm not sure exactly what you want to do. Just make sure you clean the strings first and check them xD I used addslashes, but you can also use mysql_real_escape_string() or any other cleaning function you have.

Last edited by PeachyJuice; 05-21-2008 at 07:32 PM..
PeachyJuice is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Text-Area Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.08720 seconds with 13 queries