page redirection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Des

    page redirection

    I have a web email contact us that if the cancel button is presed
    it redirects to the home page. using

    header('Locatio n: index.php');

    I have a session variable on every page which sets the a session
    variable. What I want to do is

    header('Locatio n: $return); where $return is a copy of the variable
    the page that has the problem is send.asp

    URL http://www.hopechurchuk.com/development

    there is a contact us at the top of all pages on the banner.
    sorry if this is a bit confusing.

    Desmond

  • Joachim Weiß

    #2
    Re: page redirection

    Des schrieb:[color=blue]
    > I have a web email contact us that if the cancel button is presed
    > it redirects to the home page. using
    >
    > header('Locatio n: index.php');
    >
    > I have a session variable on every page which sets the a session
    > variable. What I want to do is
    >[/color]

    perhaps your on the wrong track whith your session var[color=blue]
    > header('Locatio n: $return); where $return is a copy of the variable
    > the page that has the problem is send.asp
    >[/color]
    I think you're looking for

    $_SERVER['HTTP_REFERER'];


    to achieve your goal:


    in email.php
    use
    <input type="hidden" name="referer" value="<?php
    echo($_SERVER['HTTP_REFERER']);"/>

    in send.php
    if($_POST['submit']=="Cancel") {
    header("Locatio n: ${_POST['referer']}");
    } else {
    // normal mail processing
    // sth. like thanks your mail this
    // <a href="${_POST['referer']}">link</a> takes you where you've been

    }
    (script untested)


    hope (which is almost certain at this site ;-)) it helps

    Jo

    Comment

    • John Dunlop

      #3
      Re: page redirection

      Des wrote:
      [color=blue]
      > I have a web email contact us that if the cancel button is presed
      > it redirects to the home page.[/color]

      Why?

      --
      Jock

      Comment

      • Des

        #4
        Re: page redirection

        This only works if the person sends a successful email. If he is
        redirected back because some fields
        were missing then the cancel button takes you to the email it'self.
        Will have to investigate this further.

        Desmond.

        Comment

        Working...