thank goodness i've finally made it beyond my stumbling block of some form submission issues i was having w/ a mysql_fetch_array and trying to create a function to do it, etc. w/ the help of WeedPacket, Peppito, and i think Thorpe a while back, I have made it to my next step which is cleaning up this mess!
i have a long form (as you may have seen in my most recent posts), at the end of which i have a <textarea> for comments going into MySQL as TEXT.
i get a PHP error if i type any comments in there w/ a ' ! ' , or even this ' ' ' character itself as i'm used to using it when typing contractions like "can't won't isn't",etc.
what can i do to that <textarea> value so that it doesn't trip up the form submission w/out having to modify my normal style of typing? see below, abridged version:
(oh, a PLEASE IGNORE MY GOOFY COMMENTS TO MYSELF!! i was trying to de-bug an error-- after success, i haven't removed 'em yet!)
thanks!!
$display_block .= "
<p><strong>Tickets in Advancee:</strong>
<br />
<input type=\"text\" name=\"tix_adv\" size=\"20\" maxlength=\"25\" value=\"$00.00\" />
</p>
<p><strong>All Ages?</strong>
<br />
<input type=\"radio\" name=\"age_req\" value=\"yes\" checked=\"checked\" /> yes
<input type=\"radio\" name=\"age_req\" value=\"no\" /> no
</p>
<input type=\"hidden\" name=\"clear\" value=\"\" />
<p><strong>Alcohol Served?</strong>
<br />
<input type=\"radio\" name=\"alcohol\" value=\"yes\" checked=\"checked\" /> yes
<input type=\"radio\" name=\"alcohol\" value=\"no\" /> no
</p>
<p><strong>Concert Date Notes:</strong>
<br />
<!-- PHPBUILDER FORUMS LOOK HERE IS THE TEXTAREA -->
<textarea name=\"concert_notes\" cols=\"35\" rows=\"5\" wrap=\"virtual\">notes on this concert
</textarea>
</p>
<input type=\"hidden\" name=\"op\" value=\"add\" />
<p><input type=\"submit\" name=\"submit\" value=\"Add Date\" />
</p>
</form>
<p>Back to <a href=\"control.htm\">main control</a></p>";
}
// END ELSE B (OF IF B)
}
// END IF 'A' CAUSE FORM IS DONE AND HIDDEN VALUE TESTED AGAIN
if ($_POST['op'] == "add") {
// IF START 'D'
// IF INSIDE OF IF
// CHECKS FOR FIELDS REQUIRED TO SUBMIT THE FORM. IF MISSING DATA, FORM WILL RELOAD
if (($_POST['artist_id1'] == "") || ($_POST['show_date'] == "")) {
// IF START 'E'
header("Location: add_date.php");
exit;
}
// IF END 'E'
// INSERTING NEW DATA INTO TABLE -NOW-
// CONNECT TO DATABASE
$conn = mysql_connect("localhost", "private", "private")
or die(mysql_error());
mysql_select_db("cb_shows1", $conn) or die(mysql_error());
// SQL IS STORED INTO VARIABLE
// TO ADD FORM $POST DATA TO ARTIST_INFO TABLE
$add_artist = "insert into concerts values ('', '$_POST[artist_id1]', '$_POST[artist_id2]', '$_POST[artist_id3]', '$_POST[date_added]', '', '$_POST[show_date]', '$_POST[show_time]', '$_POST[tix_dos]', '$_POST[tix_adv]', '$_POST[age_req]', '$_POST[alcohol]', '$_POST[concert_notes]')";