PHP guru

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qw12er
    Confirmed User
    • Apr 2004
    • 799

    #1

    PHP guru

    How do you call a script on a remote server in PHP ? I tryed exec($URL); but it doesn't work.

    Also, if I open socket connection between 2 scripts on 2 separate servers will firewalls shut me down unless I enable that port ?
    I have nothing to advertise ... yet.
  • naitirps
    Confirmed User
    • May 2004
    • 761

    #2
    you can include it using include();

    include 'http://www.example.com/file.php?foo=1&bar=2';

    or you can curl() it using the curl functions if you just want it to spit you a response, ie a processor response or something of that sort...

    www.php.net/curl
    Programmer
    ICQ 44035273 | AIM spritwork | Email spritian at spritian dot com

    Comment

    • naitirps
      Confirmed User
      • May 2004
      • 761

      #3
      as for your second question, of course. that's what firewalls are meant to do open the port on the server that you are binding the listening command on... the client can have the firewall on since its not "listening", but "connecting".
      Programmer
      ICQ 44035273 | AIM spritwork | Email spritian at spritian dot com

      Comment

      • mrkris
        Confirmed User
        • May 2005
        • 2737

        #4
        Make sure you have the allow_url_fopen=On in your php.ini

        PHP-MySQL-Rails | ICQ: 342500546

        Comment

        • qw12er
          Confirmed User
          • Apr 2004
          • 799

          #5
          Thanks naitirps... I didn't thought include would work cross server ... but it works just fine.
          I have nothing to advertise ... yet.

          Comment

          • Trafficbrokercom
            Confirmed User
            • Dec 2002
            • 542

            #6
            Originally posted by mrkris
            Make sure you have the allow_url_fopen=On in your php.ini
            yeah , dont forget that so we can all make fun of you tomorrow when your site was defaced

            Comment

            Working...