Submitting Data From Form to database

liunx

Guest
Hi,

My host has recently made the upgrade to PHP 5.0, and the forms I had used to update and edit the text on my site, dont appear to work.

The text is just big chunks that include line breaks and numerous different text characters. When I try to update rows that are already in the table it doesnt work.

After sending it through a form I use the following code on the next page.

$query = "UPDATE `progs` SET `description` = '$description' WHERE `prog_id` = '$prog_id' LIMIT 1";
$result = mysql_query($query) or die ("Unable to update description");
echo("description Updated!");

Any help will be most appreciated.Where does $description and $prog_id come from?$description and $prog_id are sent from a form that redirects to the page that the code i listed is on.

I have edited different fields fine, i.e fields that are just numbers etc.

However this field, which is a text field. Doesnt seem to update. Do i need to do something before using specific characters, ie. put a / in front of any " characters in the text ?

Its weird because I used the same form method to edit my site for years until the update to php 5 and now it doesnt work.The code used to send the data:

<form name="form" form action="edit_prog_do2.php" method="post">
<input name="prog_id" type="hidden" id="prog_id" value="<? echo $prog_id; ?>" size="50">
<textarea name="description" cols="75" rows="15" id="description"><textarea></form>
 
Back
Top