formatting form data

keeping the correct formatting for submitted data from a form

Page 1 of 1

1 Replies - 737 Views - Last Post: 15 December 2009 - 11:41 AM

#1 foohoo  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 41
  • Joined: 10-August 07

formatting form data

Post icon  Posted 14 December 2009 - 09:14 AM

Hi All!

I did try to search for this on google but didn't quite know how to word it. I have a website in which I have created an area where a registered user can create a "news" post. The post contains a subject, name and then main text (news story).

the user clicks submit and the info is stored in database via php. when the user then enters the "news" section the story is displayed (retrieved via php).

my problem is formatting. At the moment if the user enters this is in the news story in the form like so:

post-
hello!

this is my post!

Thanks,
post-

whats displayed once submitted is:

hello!this is my post!Thanks,

Now, at the momenet i can enter the post and include html (<br />) and get the formatting i want, but can i make it so the info is stored and posted as written? i.e. the <br /> is automatically entered/

thanks in advance! (i hope it makes sense)

Foohoo

Is This A Good Question/Topic? 0
  • +

Replies To: formatting form data

#2 Nykc  Icon User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 728
  • View blog
  • Posts: 8,642
  • Joined: 14-September 07

Re: formatting form data

Posted 15 December 2009 - 11:41 AM

This might make a little more sense if you post your code.

:code:

So we can see what problems you are encountering.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1