the problem is when you write " you get \" right ??Originally posted by ozefrog
no luck still
Originally posted by megapuzik
the problem is when you write " you get \" right ??
well, you can always try use srt_replace ->Originally posted by ozefrog
yeah, and in the preview it shows as
joke here \"quote\"
but when u view if from the database it looks like this
joke here \
<?php $usr_joke = str_replace('\"','"',$usr_joke);?>
<input type=hidden name="usr_id" value="<?php echo $usr_id;?>">
<input type=hidden name="usr_joke" value="<?php echo $usr_joke;?>">
<input type=hidden name="usr_ans" value="<?php echo $usr_ans;?>">
bah, this board convert ascii, < will be & l t [without the spaces]Originally posted by megapuzik
well, you can always try use srt_replace ->
Not sure that this will work cuz you maybe needed to change the signs to the ascii ! (< = < ..............)PHP:<?php $usr_joke = str_replace('\"','"',$usr_joke);?> <input type=hidden name="usr_id" value="<?php echo $usr_id;?>"> <input type=hidden name="usr_joke" value="<?php echo $usr_joke;?>"> <input type=hidden name="usr_ans" value="<?php echo $usr_ans;?>">
Is that a problem ?Originally posted by ozefrog
it works, but now it has gotten rid of the quotes when it opens it fromt the sql
ok, let me understand, when someone sumbit a joke, in the preview there is no problems with the ", but after the preview, the problems appear again.Originally posted by ozefrog
yes cos i run a joke site, and a lot of jokes have quotes and stuff in it
Then just replace $usr_joke with the name of your textarea.Originally posted by ozefrog
ok
but the script doesnt have the $usr_joke variable
<?php
include("joke4cfg.php");
$date_post = date("Y-m-d H:i:s");
$connection = mysql_connect($serverAddress,$databaseName,$serverPass)or die("Couldn't make connection.");
$db = mysql_select_db($databaseName,$connection)or die("Couldn't select database");
$insertSql ="insert into joke4 values ('".$usr_name."','".$usr_id."','".$usr_joke."','".$usr_ans."','".$date_post."')";
mysql_query($insertSql);
mysql_close($connection);
include '/usr/home/o/z/ozefrog/public_html/lib/header.inc';
echo "\n\n<font face=verdana size=2><center><strong>Your joke has been added into the joke archive!</center></strong></font><br><br>";
echo "<br><br><br><br><font size=2><center>Click <a href=joke4.php>Here</a> to go back to the joke archive.</font></center>";
include '/usr/home/o/z/ozefrog/public_html/lib/footer.inc';
?>
so remove this when you add to the database, and add this line in the top of the page that show the joke.Originally posted by ozefrog
works in perview but it wont add the joke now