Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-11-2006, 09:06 PM   PM User | #1
elfeste
New to the CF scene

 
Join Date: Nov 2006
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
elfeste is an unknown quantity at this point
Question write to database and go to url problem

I have a php script which will write data entered from a form into a database table.

However, what I want the script to do is to write the data and then goto a new webpage.

Does anyone know the code to finish the script and allow the new page to be loaded into the browser?

TIA
elfeste is offline   Reply With Quote
Old 11-11-2006, 09:31 PM   PM User | #2
goughy000
Regular Coder

 
goughy000's Avatar
 
Join Date: Nov 2005
Location: England
Posts: 415
Thanks: 0
Thanked 0 Times in 0 Posts
goughy000 is an unknown quantity at this point
PHP Code:
<?php
// do database stuff


// this will send the user to example.com
header("Location: http://example.com");
?>
make sure theres no output at all on the page otherwise you will get "header already sent" errors

output includes whitespace before or after the <?php and ?>
__________________
PHP Freelancing!
ByteForums!
Scriptlance.comNeed a job done quick? post it on scriptlance! OR! your a programmer? sign up and get paid for these jobs!
goughy000 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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 Off

Forum Jump


All times are GMT +1. The time now is 09:19 AM.


Advertisement
Log in to turn off these ads.