I'm trying to attach a url at the end of an address via a string variable called redirect, and then on another page call the redirect variable.

echo "<a href=\"../access.php?redirect=/usr/member.php?id=$_GET[id]&comment=true/\">Add a comment</a>";

Okay so the above works when I get to the form. I have a hidden variable in my form that posts the get value back for a login check. When it redirects though, it only includes everything except my '&comment=true' portion. So upon redirect it's only redirecting to:

/usr/member.php?id=$_GET[id]

But actually want it redirecting to the full address I have included in my redirect statement

/access.php?redirect=/usr/member.php?id=$_GET[id]&comment=true

any takers?

Thank
- Justin

    Try

    echo '<a href="area.php?redirect='.urlencode('/usr/member.php?id='.
             $_GET['id'].'&comment=true').'"/>Add a comment</a>';
    
    //to redirect use
    header("Location: ".urldecode($_GET['redirect']));
    

      The problem is that the "&" in "&comment=true" is associated with access.php, and not /usr/member.php...

      So you should use something like this :

       $strRedirect = rawurlencode("/usr/member.php?id=$_GET[id]&comment=true");
       echo '<a href="../access.php?redirect=' . $strRedirect . '">Add a comment</a>';
      
      

      echo "<a href=\"../access.php?redirect=/\">Add a comment</a>";

        Write a Reply...