Yer, well that is what I need to do.
The form is allowing a student to enter their assignment which will include html, php and js code.
After the form is submitted the textarea is saved and then returned back to the form.
The form is pretty simple:
PHP Code:
<div class="assign" >
<form name="main_fm" action ='coaching1.php' method = 'POST'>
<span><input type='hidden' name = 'updt' value = 'yes' ></span>
<div>
<textarea id="TheTextArea" class="data1" rows="22" cols="82" name="x_assign"><?php echo $assign1 ?></textarea>
</div>
<div style="width:400px; margin:10px 0 0 174px; padding:10px; border:2px solid blue;float:left;" >
<br><br><br>
<input class="button1 bord" type="submit" value="Update Work Area">
</div>
</form>
</div>
The processing:
PHP Code:
if (@$_POST['updt'] == "yes" ){
$N_assign = $_POST['x_assign'];
$Db_assign = safe_sql($_POST['x_assign']);
$sql = "UPDATE clients SET assign1 = '$Db_assign' WHERE client_id = '$user' ";
mysql_query($sql)or die("could not UPDATE client". mysql_error());
} // end if
$sql = "SELECT * FROM clients WHERE client_id = '$user' ";
$result = mysql_query($sql) or die("could not execute FIND MEMBER $user");
if(mysql_num_rows($result) == 0 ){
$err_msg2 = "Your client details were not recognized.";
require_once ("index_fm.php");
exit;
} // end if
else { // i.e. THE CLIENT DOES EXIST
$row = mysql_fetch_assoc($result);
extract($row);
}
I don't display the data any where else, just in the textarea of the form to enable continuous updating.
Any ideas what I can do ?
BTW - I took out the strip_tags and it now displays great, but
I am a bit worried about the possible injectiion use "script" tag.
How do forums protect themselves ?
.
__________________
If you want to attract and keep more clients, then offer great
customer support.
Support-Focus.com. automates the process and gives you a
trust seal to place on your website.
I recommend that you at least take
the 30 day free trial.