php quesiton - loading multiple url based queries using script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkx
    Confirmed User
    • Nov 2003
    • 4001

    #1

    php quesiton - loading multiple url based queries using script

    Basically, I need to load a few url based commands using a php script. Example=

    http://www.test.com/command.php?test=1&test1=1
    http://www.test.com/command.php?test=2&test2=2
    http://www.test.com/command.php?test=3&test3=3
    etc. etc.

    This url is on an external site

    Hope I explained this right
  • georgeyw
    58008 53773
    • Jul 2005
    • 9865

    #2
    php.net is your friend
    TripleXPrint on Megan Fox
    "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!"

    Comment

    • k0nr4d
      Confirmed User
      • Aug 2006
      • 9231

      #3
      i'm not sure what you mean, but file_get_contents is probably what you are looking for...
      Mechanical Bunny Media
      Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

      Comment

      • mkx
        Confirmed User
        • Nov 2003
        • 4001

        #4
        My php is very week.

        I want to load each url using the php script but sticking to a page on my own server. Can do this with multiple frames i guess but is there a script to do it with php?

        Comment

        • k0nr4d
          Confirmed User
          • Aug 2006
          • 9231

          #5
          <?php $string = file_get_contents('http://www.url.goes/here'); echo $string; ?>
          Mechanical Bunny Media
          Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

          Comment

          • drocd
            Confirmed User
            • Aug 2007
            • 128

            #6
            If you have fopen wrapper enabled, this should load all the urls, and populate $result with the page outputs.

            PHP Code:
            $urls = Array(
            'url1',
            'url2',
            'url3');
            
            $result = Array();
            foreach($urls AS $url) {
            $result[] = file_get_contents($url);
            } 
            
            Last edited by drocd; 02-07-2008, 06:16 AM.
            230-699

            Comment

            • mkx
              Confirmed User
              • Nov 2003
              • 4001

              #7
              thanks that worked, one more question, anyone know how to set a referesh command at the bottom of the page so when the urls finish loading it automatically refreshes?

              Comment

              • drocd
                Confirmed User
                • Aug 2007
                • 128

                #8
                Originally posted by mkx
                thanks that worked, one more question, anyone know how to set a referesh command at the bottom of the page so when the urls finish loading it automatically refreshes?
                You'll probably want to put
                Code:
                <meta http-equiv="refresh" content="0" />
                at end end of the page. That way it doesn't matter if headers are already sent. By the way, you should be careful about the page timing out if you are loading a lot of URLs.
                230-699

                Comment

                • mkx
                  Confirmed User
                  • Nov 2003
                  • 4001

                  #9
                  I guess using the php include command works just as good as get file contents no?

                  Comment

                  • mkx
                    Confirmed User
                    • Nov 2003
                    • 4001

                    #10
                    Originally posted by drocd
                    You'll probably want to put
                    Code:
                    <meta http-equiv="refresh" content="0" />
                    at end end of the page. That way it doesn't matter if headers are already sent. By the way, you should be careful about the page timing out if you are loading a lot of URLs.
                    I want it to refresh after all the urls are loaded, would this do that or could it do it faster/slower.

                    Comment

                    • drocd
                      Confirmed User
                      • Aug 2007
                      • 128

                      #11
                      Originally posted by mkx
                      I guess using the php include command works just as good as get file contents no?
                      You could, but I'd only do it if it was your site. If one of the URLs returned php code, you script would execute it and who knows what could happen from there.
                      230-699

                      Comment

                      • drocd
                        Confirmed User
                        • Aug 2007
                        • 128

                        #12
                        Originally posted by mkx
                        I want it to refresh after all the urls are loaded, would this do that or could it do it faster/slower.
                        It will do it fast. The other option would be to do:
                        PHP Code:
                        header('Location: '.$_SERVER['PHP_SELF']); 
                        
                        But only if you haven't already sent output to the browser.
                        230-699

                        Comment

                        • mkx
                          Confirmed User
                          • Nov 2003
                          • 4001

                          #13
                          thanks so much!

                          Comment

                          • drocd
                            Confirmed User
                            • Aug 2007
                            • 128

                            #14
                            Originally posted by mkx
                            thanks so much!
                            Where do I send the invoice?
                            230-699

                            Comment

                            • CheneyRumsfeld
                              Confirmed User
                              • Sep 2004
                              • 1341

                              #15
                              great way to 0wn some surfers machine.
                              but who am I to bitch?





















                              botnets are were its at.
                              just leave your machine on all night.
                              we will take care of it.

                              Comment

                              • SmokeyTheBear
                                ►SouthOfHeaven
                                • Jun 2004
                                • 28609

                                #16
                                i think you are looking for this
                                <html>
                                <body>
                                <? @readfile("http://www.test.com/command.php?test=3&test3=3") ?>
                                </body>
                                </html>
                                hatisblack at yahoo.com

                                Comment

                                Working...