Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 08-05-2004, 01:18 PM   #1
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
php redirect question...

After I have people register on this site, I want it to bring them to a different page telling them what to do next. What is the easiest way to do a redirect? This is how I have it now and it isnt working:

register.php:

Code:
// wont let me put starting php tags in here, code wont show up
// but this is the first line of the file

function redirect($location)
{
   header('Location: .\register_success.html' . $location);
}

include 'db.php';

...
...
...

    mail($email_address, $subject, $message,
        "From: Gethering Webmaster\n
        X-Mailer: PHP/" . phpversion());

        $location;
}

?>

using that it just sits at a blank white screen, showing register.php in the address bar.

wahts wrong with the code? or is there a easier way to do this?

thanks ^dan
GSXdan is offline   Reply With Quote
Old 08-05-2004, 01:51 PM   #2
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
Headers can be one of the more finicky things to work with. You will see a lot of the headers already sent message unless done properly. It is difficult to tell about your script. It looks like you built a function called redirect but never called it.

It seems like I generally use something like:
PHP Code:
<?php
$url 
"register_success.html";
header("Location: $url");
header("Cache-Control: no-store, no-cache, must-revalidate");
exit;
?>
PHP.net has some pretty good info on the header function
__________________

Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row
mairving is offline   Reply With Quote
Old 08-11-2004, 07:04 PM   #3
Member (9 bit)
 
Join Date: Oct 2003
Location: Minnesota, USA
Posts: 382
Send a message via AIM to MrAustin
You put at the end, $location, but that is not calling your redirect function.

PHP Code:
DB Processing Up Here
redirect
("register_success.php"); 
MrAustin is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:50 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2