How to reach other pages in my website with php

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
MyerInd
Forum Newbie
Posts: 5
Joined: Thu May 16, 2002 4:36 pm

How to reach other pages in my website with php

Post by MyerInd »

I have written a php script that takes data from a form and places it in a database. At the end of this script, after successfully putting the data in the database, I want to take the person directly to another/next page on my website. I can create a link that has to be clicked on, but this is unnecessary. I want to go on to the next page automatically.

I have been unable to get fopen()/fgets() to work. readfile() works on a url like amazon.com, but only some of the items on my page are displayed.

Any suggestions?

Ron
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

Code: Select all

<?php
header("Location: index.php");
?>
User avatar
mr_griff
Forum Commoner
Posts: 64
Joined: Tue Sep 17, 2002 11:11 am
Location: Bozeman, Montana

Post by mr_griff »

You can use this code if you have not displayed anything to the user yet.

Code: Select all

<?php
//Process posted data here

//If everything worked
header ("Location: newpage.php");
exit();
?>
Post Reply