Results 1 to 8 of 8

Thread: Redirecting

  1. #1

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362

    Redirecting

    How do I get the page to automaticly refresh to a url based on the subject

    i.e.
    if

    $POST["subject"] = "Join the Mailing List"

    goto

    reciept.php?what=Thank%20you%20for%20joining

    after 3 seconds

    if not then goto

    reciept.php?what=Sorry%20to%20see%20you%20leave

    after 3 seconds

    it is relivent to my last post
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  2. #2
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    <?php header( Location: http://www.moo.com ); ?>

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I could be wrong, but doesn't the header have to be encased in quote marks:

    Code:
    <?php header("Location: http://www.moo.com"); ?>

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Yes it do.

    New to VB 6: As they've already said, use the header() function. But keep in mind that you can't have any output to the screen before you use it.

    Code:
    <?php
    
    ?>
    That's also a tricky one. Make sure your PHP tags are at the top of your document, no spaces before them, otherwise that'll count as output to the screen.

    Code:
    if ($_POST["subject"] = "Join the Mailing List") {
        header("Location: http://www.site.com/join.php?action=join");
    } else {
        header("Location: http://www.site.com/remove.php?action=kill");
    }
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    296
    I might be wrong but that header doesnt wait 3 seconds like he wanted.
    Kevin Carpenter
    Currently Working in the CAOS (CA Operating System) Group

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    the header("Location: ") is automatic. There is no wait, unless a slow connection to the internet causes that wait. Read the manual.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    If you want it to be timed

    <meta http-equiv=\"Refresh\"content=\"XXX;URL=page.php\">

    XXX = number of seconds

  8. #8
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Yep, but as I've said before some browsers don't support that, so it's better to use the PHP header if you can. Also I think some browsers may have trouble if the URL is not absolute.

Posting Permissions

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



Click Here to Expand Forum to Full Width