473,659 Members | 2,666 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 3093
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
17705
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 call the PHP program to add the record using POST. When I get the text out, it has lost it's formatting. Formatting in the text is achieved by multiple spaces not tabs, but even multiple spaces are converted to a single space and the carrage...
5
3948
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 window and confirm the selection (by pressing button), I call a function that fills the "parent" window and forces popup to close. All this is accomplished by directly accessing another list: for(var i = 0; i <= selLength; i++){
11
6584
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 where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
0
3931
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. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
3
5029
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 did it with simple text. This time around, I want to handle much more complex text. I need to preserve some kinds of features. (Yes, I have turned off magic quotes.) - Need to strip diacritics. I learned I could use htmlentities to catch...
1
1368
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 the values of other controls and not the values of textarea. Any help would be appreciated. ltrDisplayText = CType(e.Item.FindControl("ltrDisplayText"), System.Web.UI.WebControls.Literal) If Trim(Right(strDisplay, 4)) = Trim("TEXT") Then...
0
1113
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. arrayReallyRandom stores left250 values and appears 60% of the time. I have a combo box and a list of names. For eg. when i select Mark (the first name on the combo box), it will retrieve AC250L, store it as left250 and store it in arrayRandom and...
0
51115
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 choose Components . Select the checkbox next to Microsoft ChartControl 6.0(OLEDB), Click OK. Add a combobox,one Mschart control and one check box tothe existing form. Paste in the following code tothe code window Private Sub Form_Load() 'Fill the...
2
3152
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 i change something in php file using in ajax function.it not refreshed,means its shows the previous result it not get updated.i can't understand whats the prob.this is the code i m using: <? include("config.inc.php"); //error_reporting(0); ...
0
8330
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
8850
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8523
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
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
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
5649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
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

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.