Hi,
I'm building a classified ad website and have a problem.
When someone enters something into the Information field and hits "Enter" on thier keyboard; after they submit it, it doesn't show up with the vertical spaces that the "Enter" key on your keyboard does. It shows up as a regular space, like your Spacebar on your keyboard does.
I've been told the "nl2br()" code would work, but can't get it to work.
After doing more research, I'm starting to think this isn't the correct code?
Here is part of my code:
function LoadAd($id)
{
//Query for the info
$this->sql->query("SELECT * FROM ads where ID = '%s'", $id);
$ad = $this->sql->getrowset();
//"Extract" it into member variables
class_extract($ad[0], $this);
//Throw the ad's category's name into $this->category_name
$this->sql->query("SELECT name FROM categories WHERE ID = '%s'", $this->category);
$this->category_name = $this->sql->getresult();
}
if(isset($_POST['NewAd']))
{
//Create the CAd object, and create the ad
$ad = new CAd($sql);
var_dump($_POST);
var_dump($_FILES);
if($ad->NewAd($user->ID, $_POST['title'], ((isset($_POST['image_l']) && $_POST['image_l'] != '') ? $_POST['image_l'] : $_FILES['image_f']), $_POST['category'], $_POST['price'], $_POST['info'], $_POST['location']))
echo '<script language="JavaScript">alert("Success. Your ad has been placed.");</script>';
}
The varible is 'info' for the text box.
ANY HELP WILL GREATLY BE APPRECIATED.
Thanks! 🆒