Quote:
|
Originally Posted by BoNgHiTtA
Ok, trying to format a URL:
&memid=[$_SESSION["rid"]]&email=" +eml;
When I do this, it doesn't seem to want to pickup rid from our system. Actually I am thinking I have this formatted wrong.
I know I can use this:
<?=htmlspecialchars[$_SESSION["rid"]]?>
But I don't think it works in URLs.
Any suggestions? Ill pp anyone who can help me get it working 20 bucks for the trouble
|
Try something like this:
Code:
<?
// Load up params with whatever parameters you need
$params[rid] = $_SESSION[id];
$params[email] = $_SESSION[email];
$params[whatever] = "whatever";
// Convert the params array into a query string
$parmstring = '';
foreach($params as $k => $v) {
if($parmstring!="") $parmstring .= "&";
$parmstring .= "$k=".urlencode($v);
}
?>
<A HREF='http://some.url.com/foo.php?<?= $parmstring ?>'>
HTH.