Jump to content

Recommended Posts

Hey,

 

i recently decided to code an extreamly simple php cms which i can use on any websites i make. so far i have made an input form, a procesing page, a flat file, and an index with an explode function which shows the last 5 posts newest to oldest.

 

all of it works up to a point. the problem i have come accross is that when you fill in the message part of the form if you press enter to give a new paragraph it creates a new line on the flat file which the script then thinks is a new line of arrays which makes each new paragraph a new post adding it above its proper post...

 

you can see my script work in progress here.

www.xaoss.com/cms

 

i wonder if its possible to somehow stop the line break in the textarea counting as one in the flatfile.... or even better if i can replace it with a < br> tag so it shows as a new paragraph.

 

any help please?

many thanks

Link to comment
https://forums.phpfreaks.com/topic/46619-can-anyone-help-me-with-this-please/
Share on other sites

Unless you want to be "well-formed" html does not require a < /p> Something I learned along time ago. If you want to be well formed, this doubles the space but you can do < p>< /p> instead of just the < p> in the str_replace function.

 

 

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.