Re: redirecting to a success page
| From: | Randy Rinehart | Date: | Mon, 22 Nov 2004 14:22:31 +0000 |
| Subject: | Re: redirecting to a success page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202671@lists.php.net to get a copy of this message | ||
You can send a header to redirect like below.
<?php
header("location: successpage.php");
?>
Or you can print out some javascript
location.href='successpage.php';
-randy rinehart
----- Original Message -----
From: "Judson Vaughn" <jud@bizville.com>
To: <php-general@lists.php.net>
Sent: Monday, November 22, 2004 8:13 AM
Subject: [PHP] redirecting to a success page
> Group,
>
> I have a create_login.php page, which works (it inserts data into the
> database), but I need for the script once executed to redirect to a
> success.php page.
>
> It doesn't do this and I can't figure out how to do it. I've included a
> portion of the script below. This was created by Dreamweaver MX and
> modified by me.
>
> The original script, created by Dreamweaver, gives an error that says
> header has already been sent. I tried different options to no avail. I
> realize this script is now seriously hosed but thought I would include
> it anyway since others may be using Dreamweaver.
>
> Anybody know a simple fix for this? I have a feeling that it's right in
> front of me but I'm just not getting it.
>
> Jud.
>
> Judson Vaughn
> jud@seitervaughn.com | jud@bizville.com
> Seiter Vaughn Communications
> 12455 Plowman Court
> Herndon, VA 20170
> 703.450.9740
> svc
>
> ===================================================
>
> $editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
> if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
> $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
> }
>
> if ((isset($HTTP_POST_VARS["MM_insert"])) &&
> ($HTTP_POST_VARS["MM_insert"] == "form1")) {
> $insertSQL = sprintf("INSERT INTO xcart_customers (login, usertype,
> membership, password, firstname, lastname, email, pending_membership)
> VALUES ( %s ,%s, %s, %s, %s, %s, %s, %s)",
> GetSQLValueString($HTTP_POST_VARS['login'],
"text"),
> GetSQLValueString($HTTP_POST_VARS['usertype'],
> "text"),
> GetSQLValueString($HTTP_POST_VARS['membership'],
> "text"),
> GetSQLValueString($HTTP_POST_VARS['password'],
> "text"),
> GetSQLValueString($HTTP_POST_VARS['firstname'], "text"),
> GetSQLValueString($HTTP_POST_VARS['lastname'], "text"),
> GetSQLValueString($HTTP_POST_VARS['email'], "text"),
>
> GetSQLValueString($HTTP_POST_VARS['pending_membership'], "text"));
>
> mysql_select_db($database_courses1, $courses1);
> $Result1 = mysql_query($insertSQL, $courses1) or die(mysql_error());
>
>
> $insertGoTo = "success.php";
>
> ===================================================
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>