473,781 Members | 2,491 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linebreak problems when copy&paste from word

Hi,

I have a form, where the user enters text. After submit, the text is
then inserted into a PostgreSQL database. So far, so good.

The problem is, that most of my users copy&paste their text from MS Word
into the textbox. Now I have these (hidden) linebreaks in the string
that cause trouble when I furter process the text.

Is there a way (maybe just a simple PHP command) to get rid of these
formating things. I presume I would have to kind of "convert" the string
to unformatted text somehow.

Thanks for your input,
georg
Nov 23 '05 #1
2 1444
Figure out what characters are causing the problem and use
str_replace():

<http://www.php.net/manual/en/function.str-replace.php>

You can then replace any characters you don't want with something else
(like an empty string). With the weird hidden characters, you may need
to use ord() and chr() to figure out what the ASCII values are.

Nov 23 '05 #2
ZeldorBlat wrote:
Figure out what characters are causing the problem and use
str_replace():

<http://www.php.net/manual/en/function.str-replace.php>

You can then replace any characters you don't want with something else
(like an empty string). With the weird hidden characters, you may need
to use ord() and chr() to figure out what the ASCII values are.


If you look at the first two 'User Contributed Notes' on this page:

http://at.php.net/manual/en/function.ord.php

Could one of those two help me with my problem (the linebreaks)? I only
see them removing quotes etc.

What is the linebreak code, I have ro replace?

thanks a lot,
georg

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2639
by: Nelgonde | last post by:
Apologies for the basic nature of this question but I'm very inexperienced in Java. I've been given the task of disabling the cut/copy/paste functions (Ctrl-X,C & V) in our java dialogs and although some of the Bean-based ones have cut, copy and paste functions which can be overloaded, other things which use JTable, JList and the like seem less straightforward. So I was wondering if there was any standard way of tackling this problem?
1
3902
by: Phil Stanton | last post by:
Can anybody help please Has anybody got any VBA routines to copy controls on a REPORT (Not a form) to the clipboard. There are somewhat complicated ones for copying RTF and images, but I would preferably like something to copy any type of control, but principally Text Boxes, Labels and Lines TIA
1
1195
by: perryche | last post by:
Experts, Please share some light on this simple thing... I am so preplexed. Bascially, I am trying to copy Product Name from an open form and paste it to the Product Name field in Form2. Dim ProdNm As String ProdNm = Me.
0
1380
by: James | last post by:
Does annybody know how to disable clipboard copy and paste events in a Rich TextBox control. Thanks
6
2629
by: NuB | last post by:
I have a winform and a menu on the form, It allows the users to copy and paste text from text boxes. I never had to do this before, how can I copy and paste text from one box to another?
2
1750
by: deviparimala | last post by:
Hi All, I'm opening 2 notepads in my windows application. I copy data from one notepad and paste it another notepad. The data should not get pasted into the second notepad. Can I handle this programatically? Any help will do......
6
3747
by: rakeshvthu | last post by:
hi all, can we disable the copy and paste option in edit menu bar of browser my customer does not want copying using any technique so can any one help how to disable that options copy and paste in menu bar using java script urgently required loooking for quick response
5
23488
by: deve8ore | last post by:
Hello, I have a Word document called (), a named range that will open up a new Word doc dependent on what a user selects in Excel. Could someone please guide me on how to set up VBA code to copy and paste ALL sheets in the Word doc and paste into Excel? The sheets normally contain a graph or two, so if it's a copy & paste special as a picture, that's fine. Any help would be appreciated. Thank you,
0
9639
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
9474
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
10143
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
10076
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,...
1
7486
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
6729
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
5375
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
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4040
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.