| Posted by Joachim Weiί on 08/13/05 17:47 
Des schrieb:> I have a web email contact us that if the cancel button is presed
 > it redirects to the home page. using
 >
 > header('Location: index.php');
 >
 > I have a session variable on every page which sets the a session
 > variable. What I want to do is
 >
 
 perhaps your on the wrong track whith your session var
 > header('Location: $return); where $return is a copy of the variable
 > the page that has the problem is send.asp
 >
 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("Location: ${_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
  Navigation: [Reply to this message] |