473,503 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using text area to store and retrieve values...

10 New Member
hi ..
I am using a text area to feed in values to mysql ..
but its not storing all the line breaks
the text comes concatenated
even when I feed it about 40 lines... it shows all in one line ...
do i need to use something ... like stripslashes or nlbr something .. but whre....
Sep 20 '07 #1
7 3082
pbmods
5,821 Recognized Expert Expert
Heya, Pushpinderbagga.

Show us some code so that we can get a better sense of the context. You might be better off storing the data in the _SESSION....
Sep 20 '07 #2
ronverdonk
4,258 Recognized Expert Specialist
When you do a carriage return when tying data in your textbox the Crs will be returned to you when you get the textbox content.
However, when you continue typing in your textbox but let the width of the textbox make a wrap, the wrap is NOT translated into a CR or a LF.

So, are you sure you use hard CRs in your text input?

Ronald
Sep 20 '07 #3
pushpinderbagga
10 New Member
Here is the code... Please have a look ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. $jokeText = $_GET['jokeText'];
  3.  
  4. $query1 = "INSERT INTO joke (`joketext`) VALUES ('".$jokeText."')";
  5.  
  6.  
this is working but the carriage new lines or the cariage returns arnt showing when I display it in the page like

Expand|Select|Wrap|Line Numbers
  1.  
  2. $row['joketext'];
  3.  
  4.  

it simple as in this text area in which I am posting ...
the carriage returns are preserved ...
do i need to do something like

Expand|Select|Wrap|Line Numbers
  1.  
  2. $jokeText = $_GET['jokeText'];
  3.  
  4. $jokeText = trim($jokeText );
  5. $jokeText = stripslashes($jokeText );
  6. $jokeText = htmlspecialchars($jokeText )
  7.  
  8. and then insert ... and when displayig .. just 
  9.  
  10. nl2br($jokeText )
  11.  
  12. is it .... please help .. me confused...
  13.  
  14. $query1 = "INSERT INTO joke (`joketext`) VALUES ('".$jokeText."')";
  15.  
  16.  
Sep 22 '07 #4
pbmods
5,821 Recognized Expert Expert
Heya, Pushpinderbagga.

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
Sep 30 '07 #5
pushpinderbagga
10 New Member
Just take the example of a simple guestbook. If user enters some text and then presses the ENTER key 10 times thus introducing 10 line breaks and enters more text then..
while displaying i need to keep those entered newlines preserved or you may say intact..
Oct 2 '07 #6
robbiesmith79
4 New Member
Ok.

Rule #1 when submitting forms with textarea's. Use <form method="POST">

method="GET" does not retain carriage returns i.e. 40 lines in textarea's.
Oct 3 '07 #7
pushpinderbagga
10 New Member
thanks
even I thoought of this ...bt never triued implementing it ... thanks again will ... try and revert ..
Oct 3 '07 #8

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

Similar topics

6
17672
by: James Turner | last post by:
I am trying to store formatted text (windows format) into a MySQL database and then retrieve it. The field in the database is a varchar. I cut and paste the test into a form field formatted, then...
5
3939
by: Audrius | last post by:
Hello everybody, I have one page with <select> list in it, which opens a popup with another <select> list. Those two list are linked... When I select something in the list that is in popup...
11
6551
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
0
3910
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
3
5003
by: Alfred | last post by:
I want to post text field data from these HTML TEXTAREA tags to a PostgreSQL database and have it reappear back on another page exactly as I had typed it. Over the years I have done this but only...
1
1359
by: srajama | last post by:
I have a form with Repeater . The repeater has Radio buttons, textareas, Check box. How do I get the values of the text area when the form is submitted to be saved to the database. I was able to get...
0
1102
by: tigger | last post by:
Hi there, I have a problem displaying the correct random values extracted from the database. I'm using arrayRandom that stores left250 values and make it appear 90% of the time....
0
50975
debasisdas
by: debasisdas | last post by:
Here's a simple VB6 code snippet that uses the MSChart control to display Charts in VB6.0. To use this sample, please following steps Create a new project in VB6 Pull down the Project menu and...
2
3125
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if...
0
7202
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,...
0
7086
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...
0
7462
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...
1
5014
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...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
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 ...
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.