SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing variable to redirect

    I'm having an issue trying to pass a variable to a redirect to the end of am URL string

    the redirect works, however I can't figure out how to parse the $songID that is passed to it.
    PHP Code:
         if (strlen($comments) <= 0) {
           echo "No comment!";
         echo "<br><br>Redirecting to a happy place..."; ?>
         <script type="text/javascript" language="JavaScript"><!--
          setTimeout('Redirect()',4000);
          function Redirect()
          {
           location.href = 'modules.php?name=Playlist&file=songinfo&songID=" . $songID . " ';
           }
         
         // --></script>
    <? }?>
    the url is output as
    http://fm5280.com/nuke/modules.php?name=Playlist&file=songinfo&songID='&#37;20$song%20'
    instead of depending on the value of $songID.
    Last edited by fm5280; Nov 26, 2007 at 08:23. Reason: removed real value

  2. #2
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    disregard, issue resolved. used php on the $songID and it works.
    PHP Code:
    location.href = 'modules.php?name=Playlist&file=songinfo&songID=<? echo $songID;?>';

  3. #3
    Non-Member
    Join Date
    Aug 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it may be shortened
    location.href = 'modules.php?name=Playlist&file=songinfo&songID=<?=$songID?>';


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •