Help with Sending URL in Query String

Hello

I need some guidance regarding Sending URL in Query String. I have done couple of tests my self, but failed.

The URL that is being passed via Query String has a ? and couples of &.

So this is what i want.

myscript.php?blah1=a&blah2=b&url=anohterfile.php?someblah=32&blah3=5

Please guide

Thanks
Zeeshan

Did you try urlencode?

You can use [fphp]urlencode/fphp on the url you wish to place in the query string to make it safe.

Yes, I tried that, but it was not working.

Let me try it another way.


<?php
$url = 'http://www.google.co.uk/search?hl=en&as_q=sitepoint';

printf(
    'script.php?url=&#37;s',
    urlencode($url)
);

#script.php?url=http%3A%2F%2Fwww.google.co.uk%2Fsearch%3Fhl%3Den%26as_q%3Dsitepoint
?>

Then just [fphp]url_decode/fphp it on the receiving end.

Well, thanks !

I tried something and it worked with URLENCODE !

thanks

No. PHP does that already.

Ah, so it does. Thanks!