473,748 Members | 2,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Paragraph tags in script (textwrap)

1 New Member
Hi I'm working on a classified website. The problem i'm facing is that in the Place an AD I have a section where you put the description of the product.

The problem is even if the user puts paras the writeup does not take it. As an admin I have to put the <br> tags in the write-ups. How do I change the script so that it automatically take the paras.
Oct 16 '07 #1
1 1151
ronverdonk
4,258 Recognized Expert Specialist
Welcome to TSDN!

I assume that you use a textarea for the description text. You have to translate the carriage returns into breaks. Use PHP command 'newline-to-breaks' nl2br(), as follows:
Expand|Select|Wrap|Line Numbers
  1. $text = nl2br($text);
  2.  
Ronald
Oct 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
17114
by: Stefan Weiss | last post by:
Hi. (this is somewhat similar to yesterday's thread about empty links) I noticed that Tidy issues warnings whenever it encounters empty tags, and strips those tags if cleanup was requested. This is okay in some cases (such as <tbody>), but problematic for other tags (such as <option>). Some tags (td, th, ...) do not produce warnings when they are empty.
6
2045
by: Steven Bethard | last post by:
So I've recently been making pretty frequent use of textwrap.dedent() to allow me to use triple-quoted strings at indented levels of code without getting the extra spaces prefixed to each line. I discovered today that not only does textwrap.dedent() strip any leading spaces, but it also substitutes any internal tabs with spaces. For example:: py> def test(): .... x = ('abcd efgh\n' .... 'ijkl mnop\n') .... y =...
2
2031
by: Kevin Blount | last post by:
I have a string of HTML (used for a specific purpose) that I'd like to use somewhere else but as plain text. Rather than introduce a specifically created plain text version I'd like to strip the tags code from the HTML version. This in itself is easy, using a function such as: Function HTMLDecode(Expression) Dim sTemp sTemp = Expression sTemp = Replace(sTemp, "&gt;", ">", , , 1)
4
1850
by: ad | last post by:
I want to put a HTML paragraph on a WebForm in program. There are HTML tags in the paragraph, I hope the paragraph can render as normal HTML page. Which control can I use to place the HTML paragraph?
0
1211
by: Byomokesh | last post by:
Hi, I have problem facing in Linking Tags. Linking are 3 types. <!-- Just remark Id --> :( 1. Pref02fn1 <!-- This footnote text move to paragraph in place of link tags. --> 2. Page_50 <!-- Page attribute is not required in output file. Means this tag is automatically remove. -->
19
3827
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
1
1725
by: mflll | last post by:
I am having trouble responding writing a Javascript Program respond to keypresses on top of a paragraph. Here is the code I tried: <HTML> <SCRIPT Language="JavaScript"> document.write("TEeve"); function QQ(event){ alert("Key Pressed " + event.charCode()); }
3
2344
by: gomsi | last post by:
hi, i have a paragraph where i have to insert <markand </marktags to highlight the required words.i am implementing it in c++ i am currently doing it as follows.. i take the corresponding position at which the word occurs within the paragraph and the word length and store it in a map(STL)..and start inserting the tags after i scan the paragraph for the words.... although it works fine for larger words problem occurs when the word
3
1239
by: TP | last post by:
Hi everybody, Recently, I have tried to improve the look of the printed text in command line. For this, I was compelled to remove redundant spaces in strings, because in my scripts, often the strings are spreading on several lines. For example, "aaa bbb" had to be transformed in "aaa bbb". I have coded some simple functions to do that. Today, by examining Python documentation, I have found an interesting
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.