Jump to content

[SOLVED] display results from a form problems ....


Gem

Recommended Posts

Hi guys ... I am very nearly ready to go live with my new very basic cms.

 

I have one last problem I need to overcome though.

 

Basically when the admin users enter information into a form, i.e. News Updates ... they are writing it in plain text ... they have no knowledge of HTML ...

 

So the problem I have is the output comes out without any line break when we press enter on the keyboard ...

 

I'm not sure that makes sense so heres an example ...

 

Heres my form ..

 

  <form action="insert.php" method="post">
Title:
<BR> <input type="text" name="title" />
<BR>Description:
<BR> <input type="text" name="subtitle" />
<BR>News Update:
<BR>  <textarea name="article" rows="20" cols="75"> </textarea>
<BR><input type="submit" />
</form>

 

In the textarea ...

 

I need to be able to write things like

 

First Line

 

Second Line

 

Etc

Etc

 

From Gem

 

But at the moment the output im getting on my webpage is

 

First Line Second Line Etc Etc From Gem

 

How do I fix this??

 

Heres the code that displays the forms information from the database ...

 

<?php
$con = mysql_connect("CONNECTION DETAILS");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
}mysql_select_db("bssql", $con);$result = mysql_query("SELECT * FROM articles ORDER BY ID DESC");while($row = mysql_fetch_array($result))
  {
  ?><H1><?php echo $row['Title']; ?> </H1> 
    <H2><?php echo $row['SubTitle']; ?> </H2>
        <?php echo $row['Article'];
              echo "<br />";
  }mysql_close($con);
?>

Thanks in advance ..

 

Gem

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.