i wrote a form for a friend that basically generates html lists so that he can copy and paste the html straight into his documents.
the form has 10 rows, each row contains a drop down box to select the css style, a box for the url, a box for the url name and a box to add a comment.
the form works fine and outputs exactly what it should. the problem i am having though is with the comments, if i use a quote, or backslash or similar the ouput has extra backslashes. eg:
obviously i don't want this on the output. i think i have to use html entities but i am unable to get it working.don\'t
these are the variables (shortened to show just one row)
Code: Select all
$item1 = $_POST["item1"];
$link1 = $_POST["link1"];
$linkname1 = $_POST["linkname1"];
$blurb1 = $_POST["blurb1";Code: Select all
if ( trim ( $_POST['item1'] ) ) {
echo '<li class="'; echo "$item1"; echo '"><a href="'; echo "$link1"; echo '" target="_blank">'; echo "$linkname1"; echo "</a>."; if ( trim ( $_POST['blurb1'] ) ) {
echo "<br />$blurb1";
} else {
} echo "</li>"; echo "\n";
} else {
}