473,396 Members | 1,734 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,396 software developers and data experts.

quotes in textarea

and new problem... buit this time I haven't found solution in some
manual...

problem: I would like to allow <a href="link"> tag, but I'm having
problems in hidden field when checking message:

situation:

(STAGE 1 = typing <a href="link">message</a>)
<form method="post">
<textarea name="message"></textarea>
</form>

(STAGE 2 = checking message, my wish)
$message = $_POST['message']
<p>Is following correct?<p>
<p>typing <a href="link">message</a></p>
<form method="post">
<input type="hidden" name="message" value="message">
</form>

(STAGE 2 = checking message, my problem) <----!
$message = $_POST['message']
<p>Is following correct?<p>
<p>typing <a href="link">message</a></p>
<form method="post">
<input type="hidden" name="message" value="typing <a
href="link">message</a>"> <----!
</form>

there it breaks... my $message became
"typing <a href="
insead of
typing <a href="link">message</a>

what to do?
one soulution came right now to my mind... but still have some
questions:
to create copy of $message and to place that copy to hidden holder and
later, just before inserting it to mysql db, to convert it back.... and
what will happen in mysqldb with "?

preg_replace " with ******...? hm, how to find "\""?
maybe preg_replace('/\\\\?\"/', '******', $tekst) ?
--
Ja NE
http://fotozine.org/?omen=janimir
--
Oct 25 '05 #1
2 5552
> problem: I would like to allow <a href="link"> tag, but I'm having
problems in hidden field when checking message:


use addslashes() on the data in stage 2. ie
$message = addslashes($_POST['message']);
that should do the trick.

Oct 27 '05 #2
I think the problem is that quotes are only allowed to surround values
in html tags
if you want a quote anywhere else, use &quot;... same goes with <, >, &

IE <input type="hidden" name="message"
value="typing &lt;a href=&quot;link&quot;&gt;message&lt;/a&gt;">

use htmlspecialchars()

if that's not your immediate problem, it will be your next one.

Oct 28 '05 #3

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

Similar topics

2
by: Randell D. | last post by:
I've solved this problem once before but for the life of me these past couple of hours have got me nowhere... I hope someone can help... I have one form split in two... so the user can switch...
1
by: wald | last post by:
Hi group, I've set up an agenda-like system where "admins" can enter upcoming events, including a description of the event. This description can include HTML formatting and is entered in a...
7
by: Cues Plus | last post by:
Hello, I have a simple form text area for people to add comments in. The problem is that using the standard <TEXT AREA NAME="comments" ROWS=4 COLS=35></TEXT AREA> Allows people to put in...
2
by: Eric Osman | last post by:
Hi, I'm looking for a javascript function that will convert input such as this: <CLUB Code=" into this: &lt;CLUB Code=&quot;
4
by: TJS | last post by:
can the rows and columns of a textarea element with an id be changed on the fly ? if so is there an example ?
3
by: FunkHouse9 | last post by:
I'm working on a form to collect data in a textarea which and am trying to keep returns and spaces. I have a couple of functions that I Frankensteined together to replace returns with <br> and to...
6
by: Sergei Riaguzov | last post by:
Hmm, I can apply stripslashes() to a string, causing it to remove slashes near quotes (\") but how can I change this quotes to appropriate HTML quotes like &quot;?
2
by: raj | last post by:
Hi all, I'm using this code to import some a .txt files onto a webpage, but I keep seeing single quotes amd double quotes as question marks. Here's the code: <textarea disabled="disabled"...
2
by: DavidPr | last post by:
PHP Version 5.2.3 MySQL version - 5.0.45 magic_quotes_gpc - On I'm using the edit script below. When the form is displayed with the information to be edited - if there is a single quote in...
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
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
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
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...
0
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...
0
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,...

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.