Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text area doesn't submit through POST 1

Status
Not open for further replies.

DaSe

Programmer
Feb 14, 2008
149
GB
Hello guys , and again I've stumbled upon a glitch in my code - this time a bit frustrating one: Text area doesn't submit text into database after submission - here's the code:
--------
$yourSay= mysql_query("SELECT * FROM `speech` WHERE mem_id='$id' ORDER BY `speakDate` DESC LIMIT 50");

$textField = $_POST['speech'];
$textField = stripslashes($$textField);
$textField = strip_tags($$textField);
$textField = mysql_real_escape_string($$textField);


$sql = "INSERT INTO `speech` (mem_id, speak , speakDate)
VALUES('$id','$textField',now())";
$insert=mysql_query($sql) or die (mysql_error());

<form id="formSpeech" name="formSpeech" method="post" action="muProfileEdit.php" enctype="text/plain">

<textarea name="speech" id="speech" cols="45" rows="5" style="margin-left:1px"></textarea>
<input type="submit" name="submitSpeech" class="submitProfileEdit" id="submitSpeech" value="submit" />

</form>

------------------
Why oh why ? Thank you muchly for your insight...
 
What's with all the double $ for the variables?

You should be getting errors from that if only because I doubt you have a variable that has a name of the entire textarea contents.

I also have encountered issues submitting forms when enctype is specified. Perhaps removing that would help.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Heya,
thank you - those double variables were copied in here by mistake - I don't have them in my code...shortly before your suggestion I had changed enctype to 'multipart/form data' and now it seems to be working fine indeed. Before I had 'plain text'. Thank you Phil.
 
I've never needed to specify an enctype. That is unless I'm uploading a file attachment; in which case I use "multipart/form-data".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top