Reply to Re: page redirection

Your name:

Reply:


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

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация