View Single Post
Old 04-05-2005, 02:20 PM  
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
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.
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote