Jump to content

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


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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.