PHP Gurus, fix this simple code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shaze
    Confirmed User
    • Oct 2003
    • 2662

    #1

    PHP Gurus, fix this simple code

    I'm doing a redirect in a php file, but having a problem with how to display the id at the end of the URL. Basically where it says "echo $id". What's the correct code for this?

    <?php
    header("location:http://refer.ccbill.com/cgi-bin/clic...6-0000&PA=echo $id");
    exit;
    ?>


    thanks in advance
    Adult Search Engine Japanese Porn Thai Porn
  • Sam Granger
    Confirmed User
    • Dec 2004
    • 3958

    #2
    <?php
    header('http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=929876-0000&PA='. $id);
    exit;
    ?>

    $35-40 Per Signup, 60-70% Rev Share, over 80 Sites, Exclusive Sites, tons of free content
    14,000+ Free hosted Galleries, RSS feeds, Domain Hosting, Embedded Flash Movies
    Join Fetish Hits now!
    ICQ: 358652230

    Comment

    • Sam Granger
      Confirmed User
      • Dec 2004
      • 3958

      #3
      and maybe make exit to this:

      exit();

      $35-40 Per Signup, 60-70% Rev Share, over 80 Sites, Exclusive Sites, tons of free content
      14,000+ Free hosted Galleries, RSS feeds, Domain Hosting, Embedded Flash Movies
      Join Fetish Hits now!
      ICQ: 358652230

      Comment

      • Shaze
        Confirmed User
        • Oct 2003
        • 2662

        #4
        Originally posted by Sam Granger
        and maybe make exit to this:

        exit();

        cool it worked. what if I need to have a URL at the end of the redirect. code below, but i know it's wrong:

        <?php
        header('location:http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=98956-0000&PA='. $id'&HTML=http://www.site.com);
        exit();
        ?>
        Adult Search Engine Japanese Porn Thai Porn

        Comment

        • Adultnet
          Confirmed User
          • Sep 2003
          • 8713

          #5
          Originally posted by Shaze
          cool it worked. what if I need to have a URL at the end of the redirect. code below, but i know it's wrong:

          <?php
          header('location:http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=98956-0000&PA='. $id'&HTML=http://www.site.com);
          exit();
          ?>
          '.$id.'&html=http://www.site.com');


          TrafficCashGold Paying Webmasters Since 1996!

          Awesome Conversions! Fast Weekly Payments! Over 125 Tours!

          Comment

          • Adultnet
            Confirmed User
            • Sep 2003
            • 8713

            #6
            you can also make $id="yourid&html=http://www.site.com"
            with this code:
            <?php
            header('http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=929876-0000&PA='. $id);
            exit;
            ?>


            TrafficCashGold Paying Webmasters Since 1996!

            Awesome Conversions! Fast Weekly Payments! Over 125 Tours!

            Comment

            • Shaze
              Confirmed User
              • Oct 2003
              • 2662

              #7
              Originally posted by Adultnet
              '.$id.'&html=http://www.site.com');
              thank you very much! i suck at php
              Adult Search Engine Japanese Porn Thai Porn

              Comment

              • k0nr4d
                Confirmed User
                • Aug 2006
                • 9231

                #8
                you all fail. That code would rely on register_globals being on, which is off by default under php5.
                <?php
                $id = $_GET[id];
                header('Location: http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=98956-0000&PA='.$id.'&HTML=http://www.site.com');
                exit();
                ?>
                Mechanical Bunny Media
                Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

                Comment

                • polle54
                  Confirmed User
                  • Jul 2004
                  • 4626

                  #9
                  Originally posted by k0nr4d
                  you all fail. That code would rely on register_globals being on, which is off by default under php5.
                  <?php
                  $id = $_GET[id];
                  header('Location: http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=98956-0000&PA='.$id.'&HTML=http://www.site.com');
                  exit();
                  ?>
                  Agreed... BUT you don't know he has to get ID by GET do you? and you forgot two quotation marks in your get.

                  Shaze Here is a example where it's a bit more split up.

                  You should really read http://w3schools.com/php/default.asp

                  It takes 30 minutes and will save you many many hours in the future.

                  <?php
                  $id = $_REQUEST["id"];
                  $urlstring = "http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=98956-0000&PA=".$id."&HTML=http://www.site.com";
                  header("Location: " . $urlstring);
                  exit();
                  ?>
                  Last edited by polle54; 06-02-2008, 04:14 AM.
                  ICQ# 143561781

                  Comment

                  Working...