FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » & - form and session problem!
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: & - form and session problem! [message #173526 is a reply to message #173521] Mon, 18 April 2011 07:46 Go to previous messageGo to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 17/04/2011 22:39, lamb escribió/wrote:
> I'm running an ecommerce site using php.
>
> I have problem with customers that doesn't accept cookies.
>
> In these cases PHP uses the GET params to transfer session in (osCid im
> my case) from a page to another.
>
> But I have problems with forms!
>
> When I have a form the link:
>
> http://mysite.com/index.php?language=fr&osCid=xxxxx
>
> is automatically transformed in
>
> http://mysite.com/index.php?language=fr&osCid=xxxxx
>
> where & becomes &

You give little detail, but it seems that your software is encoding HTML
entities twice. But that looks like a too serious bug to remain
unnoticed until now.

> So in the arrival page $_GET[osCid] is empty!
>
> There is a way to avoid this substitution?

As I said, you need to actively encode HTML entities twice in order to
get this:

$url = 'http://mysite.com/index.php?language=fr&osCid=xxxxx';
$url = htmlspecialchars($url);
echo '<a href="' . htmlspecialchars($url) . '">Home</a>';

Check the code.


> Or there is a way, using mod_rewrite, to transform
> http://mysite.com/index.php?language=fr&amp;osCid=xxxxx in
> http://mysite.com/index.php?language=fr&osCid=xxxxx.

I would not play with that, it can only lead to even more obscure bugs.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: mysqli - can I bind wildcard params, and just get a result back to make a hash?
Next Topic: Parameter passing question
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 01:11:12 GMT 2024

Total time taken to generate the page: 0.05139 seconds