Forum Moderators: coopster
I can't seem to pick up the value from a textarea what am I missing?
The textarea code looks like this:
<textarea rows="20" cols="90" name="entry"></textarea>
and to pick it up I am using this:
echo "Entry = " . $_REQUEST["entry"] . "<br>";
I've tried to use $_POST but that doesn't work either. There's no problem with picking up the other fields so the form basically works but not the textarea.
Thanks in advance for any help.
--
Jan
Your syntax is "technically" correct, however it should look something like this:
echo "Entry = ".$_POST["entry"]."<br>";
#
#or, if you are running a PHP version < 4.1.0, use the following
#
echo "Entry = ".$HTTP_POST_VARS["entry"]."<br>";
Other than that, you should be good. Oh, and one more thing. Make sure you have something either typed into the textarea or between the tags of the textarea as if you don't, the $_POST variable will have nothing in it, and appear to be empty.
Good luck! :)
eelixduppy's response gave me the idea of trying to hardcode some text in between the tags to see if I got a response that way which I did, so I tried that and adding text into the text box and that worked, took the hard coding out and it carried on working. I do hate it when that happens, I don't mind problems so much if I can feel I've fixed them (albeit with help), it's unsettling when they fix themselves.
Thanks for the code snippet whoisgregg, I have a feeling I will be using it a lot.