Here's my code
All this does is take input from the form and shove it in to a MySQL database.
problem is, the address is a text area and I use 'return' for a new line. Now within MySQL it adds 'rn' to the end so when I display the results on a different page I get 'rn' showing.
Not sure how to get around this apart from str_replace.
Also, when it displays the results it just gives the address in one long line. Is there a way to break it up into the correct format?
123 fake street
fake town
fake city
as opposed to 123 fake streetrnfaketownrnfakecityrn
Ta
Code:
<?php
} else {
$name = stripslashes(mysql_real_escape_string($_POST['name']));
$address = stripslashes(mysql_real_escape_string($_POST['address']));
$postcode = stripslashes(mysql_real_escape_string($_POST['postcode']));
$telephone = stripslashes(mysql_real_escape_string($_POST['telephone']));
$contact = stripslashes(mysql_real_escape_string($_POST['contact']));
mysql_query("INSERT INTO `site` (name, address, postcode, telephone, contact) VALUES ('$name','$address','$postcode','$telephone','$contact')");
echo "Thank you. The site has been added to the database";
}
mysql_close();
?>
All this does is take input from the form and shove it in to a MySQL database.
problem is, the address is a text area and I use 'return' for a new line. Now within MySQL it adds 'rn' to the end so when I display the results on a different page I get 'rn' showing.
Not sure how to get around this apart from str_replace.
Also, when it displays the results it just gives the address in one long line. Is there a way to break it up into the correct format?
123 fake street
fake town
fake city
as opposed to 123 fake streetrnfaketownrnfakecityrn
Ta