hey guys, im having a problem with backslashes on quotes. when a field contains an apostrophe, the image displays \\' and since the field's value is echoed back into the field, the field displays \'
here is my code that previews the image with data from the previous page, and also allows changes, and submits to itself-
<?
include "../common_db.inc";
?>
<img width="500" height="300" src="coupon_preview.php?title=<? echo $title; ?>&details=<? echo $details; ?>&details2=<? echo $details2; ?>&details3=<? echo $details3; ?>&details4=<? echo $details4; ?>&details5=<? echo $details5; ?>&details6=<? echo $details6; ?>&details7=<? echo $details7; ?>&value=<? echo $value; ?>&disclaimer=<? echo $disclaimer; ?>&disclaimer2=<? echo $disclaimer2; ?>&disclaimer3=<? echo $disclaimer3; ?>&disclaimer4=<? echo $disclaimer4; ?>" alt="" height="50" width="500" border="0">
<form method="post" action="<? echo $PHP_SELF; ?>">
<b>Title</b><br>
<input type="text" name="title" value="<? echo $title; ?>"><br>
<b>Details</b><br>
<input type="text" name="details" value="<? echo $details; ?>"><br>
<input type="text" name="details2" value="<? echo $details2; ?>"><br>
<input type="text" name="details3" value="<? echo $details3; ?>"><br>
<input type="text" name="details4" value="<? echo $details4; ?>"><br>
<input type="text" name="details5" value="<? echo $details5; ?>"><br>
<input type="text" name="details6" value="<? echo $details6; ?>"><br>
<input type="text" name="details7" value="<? echo $details7; ?>"><br>
<b>Value</b><br>
$<input type="text" name="value" value="<? echo $value; ?>" size="7"><br>
<b>Disclaimer</b><br>
<input type="text" name="disclaimer" value="<? echo $disclaimer; ?>"><br>
<input type="text" name="disclaimer2" value="<? echo $disclaimer2; ?>"><br>
<input type="text" name="disclaimer3" value="<? echo $disclaimer3; ?>"><br>
<input type="text" name="disclaimer4" value="<? echo $disclaimer4; ?>"><br>
<input type="submit" value="Preview Coupon">
</form>
and here's coupon_preview.php:
<?
Header("Content-type:image/jpeg");
$value = '$' . "$value";
$im = imagecreatefromjpeg("./images/coupon.jpg");
$black = imageColorAllocate ($im, 0, 0, 0);
$white = ImageColorAllocate ($im, 255, 255, 255);
imagestring ($im, 5, 170, 20, $title, $black);
imagestring ($im, 4, 170, 50, $details, $black);
imagestring ($im, 4, 170, 65, $details2, $black);
imagestring ($im, 4, 170, 80, $details3, $black);
imagestring ($im, 4, 170, 95, $details4, $black);
imagestring ($im, 4, 165, 110, $details5, $black);
imagestring ($im, 4, 140, 125, $details6, $black);
imagestring ($im, 4, 100, 140, $details7, $black);
imagestring ($im, 5, 420, 20, $value, $black);
imagestring ($im, 2, 20, 200, $disclaimer, $black);
imagestring ($im, 2, 20, 215, $disclaimer2, $black);
imagestring ($im, 2, 20, 230, $disclaimer3, $black);
imagestring ($im, 2, 20, 245, $disclaimer4, $black);
imagejpeg($im);
?>
Thanks for any help, i much appreciate it...