Something along the lines of: if( ereg("/confirm.php", $_SERVER['HTTP_REFERER']) ) { Header("Location: thanks.php"); exit; }else { Header("Location: index.php"); exit; }
You might want to do some additional checking as well.. the above would match both "/path/to/confirm.php" as well as "/path/to/somewhere/else.php?fakeit=/confirm.php") I'll leave that sort of stuff up to you :) On Wed, 30 Jan 2002, jas wrote: > Ok I think I know what I need to learn... how can I do a redirect based on > whether or not a user came from a certain page? For example... if a user > comes from a page called confirm.php then it takes them to a page called > thanks.php and if the user came from a different server or typed the url > directly then it would redirect the user to the index.php page? > Thanks in advance... > Jas > P.S. A tutorial on this would definately prevent me from posting the same > question again. =) > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php