Web url in form

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a form in which a user is going to enter (actually paste) a web
address into a form field. The URL will have a query string (e.g.
http://www.something.com?fld1=xxx&fld2=12345 ). When the form is posted, I
properly receive the address in $_POST. After I process it, I want to put
its value back into the field. Assuming the field name is v1, my <input>
tag has the following field:

 ... value="' . $_POST['v1'] . '" ...

Unfortunate, the query part of the string is truncated off and all that
shows up in the field is the base portion of the URL. What PHP function
will prepare the field such that the full URL - with query - will display
in the field?

Re: Web url in form

*** Michael Satterwhite escribió/wrote (Mon, 21 Feb 2005 14:31:41 GMT):
Quoted text here. Click to load it

.... value="' . htmlspecialchars($_POST['v1']) . '" ...

-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox

Re: Web url in form

Alvaro G. Vicario wrote:

Quoted text here. Click to load it

Thanks much. I appreciate it.

Re: Web url in form

Quoted text here. Click to load it

This will break if value is delimited with single quotes (see ENT_QUOTES
in htmlspecialchars).

Site Timeline