# Automatic php redirectering

**URL:** https://forum.kirupa.com/t/automatic-php-redirectering/166257
**Category:** Uncategorized
**Created:** [October 18, 2005, 1:41pm UTC](https://forum.kirupa.com/t/automatic-php-redirectering/166257 "2005-10-18T13:41:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![netrix](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@netrix](https://forum.kirupa.com/u/netrix)
#### Post date: [October 18, 2005, 1:41pm UTC](https://forum.kirupa.com/t/automatic-php-redirectering/166257/1 "2005-10-18T13:41:32Z")

</div>

Hi guys… I did a form and everything is working, but i want to add an automatic redirectering to it. I want to wait like 2 - 4 seconds before redirectering the user to another page or to the page he was before going into the form. How can i do that???

Here’s something like the php code i’m using for the form…

```php
<?php
if(isset($_POST['submit'])) {

	$name_field = "xxxxxxxx";
	$state = "Puerto Rico";
	$direc = "1234 Elm St.";
	$city = "xxxxxx";
	$zipcode = "88888";

	$fh = fopen("info.txt","a");

	$information = "$name_field,$direc,$city,$state,$zipcode";

	echo "Thanks! THe data has been submitted.";

	fwrite($fh,$information."
");

	fclose($fh);

} else {
	echo "Please go back to where ever u where before!";
}
?>

```

thanks in advanced!!

🔗
