Include and allow_url_fopen

Discussion in 'PHP' started by Guthix121, Jun 21, 2010.

  1. #1
    I'm trying to include an external file onto my server. However, allow_url_fopen does not allow this. I do not want to turn it to ON because that is a huge security compromise. How else could I get this file?

    My friend said to use file_get_contents, however I am trying to include a .inc and .dat file which aren't supposed to be echoed. I'm not sure how much I want to use cURL either, but I will if its the only way.

    This is for mod_geoip, by the way.
     
    Guthix121, Jun 21, 2010 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Probably just will need to use curl functions.

    Why not install mod_geoip on your server, vs. relying on another remote server to generate your page?
     
    digitalpoint, Jun 21, 2010 IP
  3. Guthix121

    Guthix121 Well-Known Member

    Messages:
    1,078
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    105
    #3
    How would using the actual server vs PHP (with external includes) affect resource/bandwidth usage?
     
    Guthix121, Jun 21, 2010 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Depends how many requests you are making. The bigger issue I would think is if the remote server you are relying on was down... it would make your site appear to be broken.
     
    digitalpoint, Jun 21, 2010 IP
  5. Guthix121

    Guthix121 Well-Known Member

    Messages:
    1,078
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    105
    #5
    The remote server is actually tons more reliable than the main server I'm using. :p
     
    Guthix121, Jun 21, 2010 IP