Announcement

Collapse
No announcement yet.

simple redirect question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • simple redirect question

    How can i redirect a user back to where he came from?

    in other words,

    file1.php (has a require command to main.php)

    when someone enters file1.php, he goes to main.php (by default), i want the user to come back to file1.php after checking main.php

    it is not only for file1.php, it is for any file that checks main.php (i.e file1.php, file2.php, file3.php .... )

    The code is probably with HTTP_REFERER...i am not sure ..

    please help

    Thanks in advance

  • #2
    May you have a better chance if you ask in the PHP coiding forum. They talk about PHP coding and this question is about PHP coding. I think you just need to give over a variable like from=page and then make a function which calls header=("location:file").
    Ueli

    Comment


    • #3
      maybe like this!

      PHP Code:
      $referrer_file = ("$HTTP_REFERER");
      print(
      "
      <script language='javascript'>
      window.location=\"
      $referrer_file\";
      </script>
      <a href='
      $referrer_file'>if not redirected, pls click here!</a>
      "
      ); 
      this should be useful for you!
      Last edited by sLYsHARk; Fri 27 Jul '01, 4:08am.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X