Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder goughy000's Avatar
    Join Date
    Nov 2005
    Location
    England
    Posts
    415
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •