How can I use a function that's in a file on another server?

Discussion in 'PHP' started by mcdeere02, Aug 7, 2009.

Thread Status:
Not open for further replies.
  1. #1
    I am trying to use php's "include" to include a script that's on a separate server.

    For example purposes the file's name is "library.fn.php" located at www.example.com/functions/
    library.fn.php has the function userName().

    I need to call the function that's in "library.fn.php" from www.newexample.com.
     
    mcdeere02, Aug 7, 2009 IP
  2. thesirwolf

    thesirwolf Peon

    Messages:
    4
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Thats a php.ini setting.

    "allow_url_include" this setting must be "on" in your php.ini

    allow_url_include = on
     
    thesirwolf, Aug 7, 2009 IP
  3. zandigo

    zandigo Greenhorn

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    Oh well, you just got banned, anyway, I think I should say this.

    It is impossible to include a function from remote server, especially, the target file is .php files as the remote server will process the file and return result to your server. There will be not a single variable or function for your server to inherit from that files.

    However, if the target file is not .php, when it's marked with proper <?php and ?>, your server may parse it and inherit those function.
     
    zandigo, Aug 8, 2009 IP
  4. sayedjustetc

    sayedjustetc Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    see if php curl help. Google it
     
    sayedjustetc, Aug 8, 2009 IP
  5. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #5
    He got banned because it's just a spam bot. They're getting questions from sitepoint forums and posting them here.. So he won't read your response anyway :)
     
    premiumscripts, Aug 8, 2009 IP
  6. zandigo

    zandigo Greenhorn

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #6
    hahaha, spam bot with over 300 replies. Such a well-made, clever one. I decided to post my opinion as I think it could be a contribution for someone else :)
     
    zandigo, Aug 8, 2009 IP
Thread Status:
Not open for further replies.