quick php question?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • comeplay
    Confirmed User
    • Nov 2004
    • 1435

    #1

    quick php question?

    Does this make any sense to any of you?

    1. I have a PHP site - it loads all pages referencing < head.inc.php >

    2. I need a curl feature to include in the < head.inc.php > file that performs 1 of 2 things.

    Step 1 - downloads a webpage that contains YES or NO only from a different server and based on the results either:

    (a) result = yes (does nothing - page loads as normal)
    (b) result = no (forwards the user to a different website address)
    Top virtual hosts for under 10$? www.hostmylife.com | icq 50663030
  • Why
    MFBA
    • Mar 2003
    • 7230

    #2
    yes it makes sense, what do you want to know about it?

    Comment

    • Deej
      I make pixels work
      • Jun 2005
      • 24386

      #3
      of course, its all about if echoing....

      Deej's Designs n' What Not
      Hit me up for Design, CSS & Photo Retouching


      Icq#30096880

      Comment

      • Hell House Vic
        Pay to Cum
        • Aug 2004
        • 1029

        #4
        it makes sense. so what's the question?

        Contact Me - ICQ: 206851710 eMail vic (at) hellhousemedia (dot) com
        'Satanism is like Capitalism for teens' - Ty HellHouse

        Comment

        • Why
          MFBA
          • Mar 2003
          • 7230

          #5
          lets see if it will let me write it in here... but you dont need curl at all.
          Code:
          $url = "url";
          $result = file ($url);
          if($result = "yes"){
           echo "yes";
          }else{
           echo "no";
          }
          that should work, or something along those lines.

          Comment

          • Why
            MFBA
            • Mar 2003
            • 7230

            #6
            Code:
            $url = "url";
            $result = file ($url);
            if($result && $result[0] == "yes"){
             echo "yes";
            }else{
             echo "no";
            }
            sorry, that is better. my bad.

            but that would only work if fopen is allowed to get URLs, if not then you still need curl

            Comment

            • GrouchyAdmin
              Now choke yourself!
              • Apr 2006
              • 12085

              #7
              This whole design is absolutely atrocious and going to cause not only latency through this major bottleneck, but one hell of a point of failure.

              If you use file(), or cURL, set a reasonable timeout value.

              Comment

              • Hell House Vic
                Pay to Cum
                • Aug 2004
                • 1029

                #8
                why - he'll need curl since the page is on a different server as is a script not a flat file.

                Contact Me - ICQ: 206851710 eMail vic (at) hellhousemedia (dot) com
                'Satanism is like Capitalism for teens' - Ty HellHouse

                Comment

                Working...