Re: problem with composing URL with GET Variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 23, 2007 1:39 am, Angelo Zanetti wrote:
> Dear all.
>
> I have  a script that is called by an AJAX popup. Now I use an image
> file to get the path of an image for an <img> tag
>
> eg:
>
> <img border="0" id="middleImage" name="middleImage" src="<? echo
> $getImageURL; ?>" >
>
>
> the $getImageURL is composed as follows:
>
> $getImageURL = "getImage.php?imageid=".
> $imageID."&height=275&width=375&quality=65";

This isn't valid HTML. The & should be changed to &amp; before the
browser tries to render them:

echo htmlentities($getImageURL);

> However when I look at the URL that gets sent its as follows:
>
> getImage.php?imageid=10&amp;height=275&amp;width=375&amp;quality=65

It seems VERY unlikely that this is what actually being requested, and
MUCH more likely that what you are viewing is post-processed to "fix"
the & to be &amp; for a browser output, which is what you should have
done way back when you sent it out...

Though it's POSSIBLE that something is trying to correct your mistake
above, far too late, and just making things worse rather than
better...

> Which is obviously incorrect.

Actually, it's not incorrect, most likely.

> $getImageURL = html_entity_decode("getImage.php?imageid=".
> $imageID."&height=275&width=375&quality=65");

This is most definetly wrong as it's going to try to decode things
that weren't html entities in the first place, and should have been.

So it's going 90 miles an hour in the exact opposite direction of
where it should...

> But that doesn't seem to be working. .  . As the html_entity_decode
> should the &amp sign to the & sign?
>
> Am I going in the right direction or can anyone else let me know if
> there is something I am missing or should be doing?

Exactly what are you using to examing the Request URI which is showing
the &amp; bit?

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux