Re: redirecting to a new page
| From: | Cymen Vig | Date: | Wed, 26 Jul 2000 05:23:22 +0000 |
| Subject: | Re: redirecting to a new page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8207@lists.php.net to get a copy of this message | ||
See Header() - say you have redirect.php and you link to it with
redirect.php?goto=http://www.php.net then you could have this in
redirect.php:
<?php
Header( Location: $goto );
?>
and off they go to $goto. Of course you could do all of your work in one
php file instead of multiple files - like so:
test.php:
<?php
$me = "test.php";
if ( isset ( $add_data ) )
{
mysql_connect();
mysql_select_db();
mysql_query(); // put in that data
Header ( Location: http://you-have-data.com );
} else {
print "<form action='$me?add_data' method='post'>";
print "yadda yadda"; // print out the form to enter data
?>
Just an idea... Any pointers as to why this is not a good idea welcomed
:)...
Cymen Vig
cvig@raw-io.com
----- Original Message -----
From: "Generic Player" <generic@unitedtamers.com>
> I have a page that takes info in from a form, and sends it to a php
> page. That page then checks if the info is valid or not. If its not it
> gives them the error, but if it is, then it adds the data to the
> database, and I would like it to then re-direct them to another page.
> The only things I could find to send people to a new page needed to be
> used in the header, which won't work. Any ideas?
>
> thanks
> Generic Player