What php function would I use

Discussion in 'PHP' started by easydolla, Feb 26, 2009.

  1. #1
    How could I make a redirect ... say I have a php page called pay.php

    there is a checkbox, when they check it and press submit, the page refreshes and the URL is now pay.php?term_box=checked

    so when the server gets the response that the checkbox is checked, it releases a redirect to a page

    this way it decreases server load on validation

    anybody know how I could do this?
     
    easydolla, Feb 26, 2009 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    If (isset(whatever the submit button is called)) { echo"<META HTTP-EQUIV = 'Refresh' Content = '0; URL='where_ever you want them to go.php'>";
    {
    else { do what ever else you want including show the initial page }

    Note most of this is pseudo style.
     
    Colbyt, Feb 26, 2009 IP
  3. easydolla

    easydolla Peon

    Messages:
    403
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ? I dont understand that code at all
     
    easydolla, Feb 26, 2009 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    
    <?php
    if($_GET['term_box'] == 'checked')
    {
      header("Location: http://site.com");
      exit();
    }
    ?>
    
    PHP:
    Peace,
     
    Barti1987, Feb 26, 2009 IP
  5. canishk

    canishk Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You better add
    ob_start
    PHP:
    at the first line of the code, otherwise may show a warning/error.
     
    canishk, Feb 26, 2009 IP
  6. easydolla

    easydolla Peon

    Messages:
    403
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks bro
     
    easydolla, Feb 26, 2009 IP