tags:

views:

23

answers:

1

i post something from a form and the form's action is a page perform.php

when i go to perform.php

<?php
$g = $_POST['my'];
sleep(3);
echo ("sdfsdfdsfdsfdsfdsf");
// a lot of other PHP & DB related code

//after a lot of code last line is
header("Location: source.php");
?>

what it does is that it does everything that needs to be done and i see loading of page and after that loading i don't actually get to see perform.php for which the code i have given... and i am directed to source.php

what i was intending is from the form page i go to perform.php and there i will show some text and and after 3 seconds it will be redirected to source.php but that failed...

HOW TO DO IT

+4  A: 
<meta http-equiv="refresh" content="3;url=http://somewhere.com/source.php"&gt;

Don't do it via PHP. Why?

What PHP currently does:

Request comes in -> PHP does some stuff, waits 3 seconds WITHOUT SENDING ANY DATA TO THE BROWSER -> PHP tells browser to go to source.php (without showing anything).

What it should do:

Request comes in -> PHP returns HTML and includes tag to tell browser to redirect after 3 secs.

Robus
thanks.........
Junaid Saeed