how to

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kujtim
Forum Commoner
Posts: 35
Joined: Sat Oct 25, 2003 4:00 am
Location: kosovo
Contact:

how to

Post by kujtim »

I want thet wen you click submite to open the page the
the displayed page will be activ onli a few seconds and then withaut clicking and doing nothing the page should be remuved by it self and get back where was before......

help me
liviu
Forum Newbie
Posts: 16
Joined: Fri Jul 18, 2003 6:39 pm
Location: Tulcea, Romania

Post by liviu »

User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

also, have a look at [php_man]header[/php_man].

Code: Select all

<?php
header("location: ".$_SERVER["HTTP_REFERER"]);
?>
You can also add a delay if you like. Do note, however, that according to PHP manual, $_SERVER["HTTP_REFERER"] depends on the browser and apparently not all browser handle it correctly.
Personally, I've not had any browser giving me problems with it.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

patrikG wrote:Personally, I've not had any browser giving me problems with it.
Just an example: Opera with 'referer logging' option turned off.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I would use a plain old meta refresh. :)

Code: Select all

<?php
$back = $_SERVER['HTTP_REFERER'];
$seconds = 15; // time measured in seconds
?>
<meta http-equiv="refresh" content="<?php echo $seconds; ?>; url=<?php echo $back; ?>">
<?php
// this will send them back if nothing happens on the page
?>
this must be within the <head> tags
Post Reply