473,378 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

everything after ' character is not displayed

Hello

I have been getting strange behaviour when using ' in by textboxes.

eg inputting the following
this is some test text ' and so is this

is saved to the mysql database ok as

this is some test text /' and so is this (with add slashes)
or
this is some test text ' and so is this (without add slashes)

mysql field is VARCHAR(255)

but when I retreive the data and display in textboxes on my web page, text
area type (below) is ok
<textarea class='BodyText' style='WIDTH: 85%' name="textarea"><?php echo
$opta; ?></textarea>

but input type (below) cuts everything off after the ' character. However
this does not happen with other characters such as " or /
<input type='text' class='BodyText' style='WIDTH: 85%' name='test'
value='<?php echo $opta; ?>'>

can anyone explain this behaviour and have a solution so that text with any
' characters in it is fully displayed?
Ian
Oct 13 '06 #1
4 1496
mantrid wrote:
Hello

I have been getting strange behaviour when using ' in by textboxes.

eg inputting the following
this is some test text ' and so is this

is saved to the mysql database ok as

this is some test text /' and so is this (with add slashes)
or
this is some test text ' and so is this (without add slashes)

mysql field is VARCHAR(255)

but when I retreive the data and display in textboxes on my web page, text
area type (below) is ok
<textarea class='BodyText' style='WIDTH: 85%' name="textarea"><?php echo
$opta; ?></textarea>

but input type (below) cuts everything off after the ' character. However
this does not happen with other characters such as " or /
<input type='text' class='BodyText' style='WIDTH: 85%' name='test'
value='<?php echo $opta; ?>'>

can anyone explain this behaviour and have a solution so that text with any
' characters in it is fully displayed?
Ian

What's it look like when you view the source?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 13 '06 #2
Rik
mantrid wrote:
but input type (below) cuts everything off after the ' character.
However this does not happen with other characters such as " or /
<input type='text' class='BodyText' style='WIDTH: 85%' name='test'
value='<?php echo $opta; ?>'>

can anyone explain this behaviour and have a solution so that text
with any ' characters in it is fully displayed?
Which is exactly as is should be. The ' in the text means it's the end of
the value. I't invalid HTML, and most browsers will handle the 'extra'
attributes (that's what it is after the ') by discarding it.

htmlspecialchars() or htmlentities() your $opta.

Grtz,
--
Rik Wasmus
Oct 13 '06 #3
You have an article on http://www.nurazije.co.nr/ ...
It will help you with quotes..
Regards,
Ashraf Gheith

Oct 13 '06 #4
thanks all
that was the function i needed
ian

"mantrid" <ia********@virgin.netwrote in message
news:%s******************@newsfe7-gui.ntli.net...
Hello

I have been getting strange behaviour when using ' in by textboxes.

eg inputting the following
this is some test text ' and so is this

is saved to the mysql database ok as

this is some test text /' and so is this (with add slashes)
or
this is some test text ' and so is this (without add slashes)

mysql field is VARCHAR(255)

but when I retreive the data and display in textboxes on my web page, text
area type (below) is ok
<textarea class='BodyText' style='WIDTH: 85%' name="textarea"><?php echo
$opta; ?></textarea>

but input type (below) cuts everything off after the ' character. However
this does not happen with other characters such as " or /
<input type='text' class='BodyText' style='WIDTH: 85%' name='test'
value='<?php echo $opta; ?>'>

can anyone explain this behaviour and have a solution so that text with
any
' characters in it is fully displayed?
Ian


Oct 13 '06 #5

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

Similar topics

2
by: David Angelovich | last post by:
Hi I need to output a new page character using the PrintWriter (java.io.PrintWriter) but I don't now what character to use.... Form feed (\f) characters seem to do nothing.... Is there...
2
by: kamp | last post by:
Hello, Below is a snippet from a schema. The second enumeration should contain an i umlaut (archaďsch) but when I use this schema with Altova's Stylevision software the iumlaut is not displayed...
1
by: Trpčić Ivan | last post by:
I have created MySQL database on XP SP2 machine in cp1250 character-set, and loaded some data in the same character-set. When I read table using EMS MySQL Managet 3 Lite, I get croatian characters...
2
by: Mike Turco | last post by:
I have a bunch of text files I'm trying to parse. The files all have several occurrences of chr(26), which is EOF (End Of File). Each file is ~ 1meg of text, and every file is a real mess. The...
14
by: VMI | last post by:
Everytime I open my machine's MSDN and look for a subject, when I double-click on anything, I get "The page cannot be displayed" . What's wrong?
12
PEB
by: PEB | last post by:
Hi everybody, I've a recordset based on a table. Each field in the table is retreated in the recordset, so that the length of the field increases 5 times! The retreatement is using this kind...
6
by: ehabaziz2001 | last post by:
My Program turned a char variable into string using null character but unexpected character displayed infront of the variable after using printf . Syntax : ------------- #include <stdio.h> ...
66
by: dattts | last post by:
what is the difference between a single character and a string consisting only one character
10
by: Paul W | last post by:
Hi all, I have an application that reads data in from a text file and stores it in a database. My problem is that there are some characters in the file that aren't being handled properly. For...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.