Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2003
    Posts
    50

    Unanswered: Getting current url

    Hi!

    I implemented sessions and when the user logins or logouts from the system I want to know from wich page he did it so I can redirectionate him to the same page. Is there a function to retrieve current URL? How can I do this?

    Thans for your attention!
    Ah! Não ser eu toda a gente e toda a parte!

  2. #2
    Join Date
    Jan 2004
    Posts
    2

    Re: Getting current url

    Code:
    $_SERVER['PHP_SELF']

  3. #3
    Join Date
    Dec 2003
    Posts
    50
    Thanks a lot. It really helps me!
    Ah! Não ser eu toda a gente e toda a parte!

  4. #4
    Join Date
    Dec 2003
    Posts
    50
    But testing it more carefully, if the user is currently viewing a page with a parameter:

    listen.php?nick=spike

    when I redirecctionate him to the $_SERVER['PHP_SELF'] the parameter in the url disappears and the page is no longer valid. Is there a way to avoid removing the parameter?
    Ah! Não ser eu toda a gente e toda a parte!

  5. #5
    Join Date
    Dec 2003
    Posts
    50
    Nevermind! I have access to the parameters so I just have to make

    PHP Code:
    $url $_SERVER['PHP_SELF'];
    if (
    $nick2)
       
    $url .= "?nick2=$nick2"
    Thanks!
    Ah! Não ser eu toda a gente e toda a parte!

  6. #6
    Join Date
    Jan 2004
    Posts
    2
    Of cource:
    PHP Code:
    $_SERVER['QUERY_STRING'
    For more information take a look to http://ee.php.net/reserved.variables

Posting Permissions

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