Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    107
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Run the file from PHP?

    Hello friends,

    I am working on some project related to Indian Stock exchange.

    I have a feed URL http://nseindia.com//marketinfo/equi...RUTI&series=EQ

    I know I can use Ajax to run this URL and fetch the data BUT I don't want to do it this way.

    Rather, is there any way that I can run this URL from PHP script and store the result into PHP array?

    I don't want to use JavaScript or Ajax for this.
    Programming & Webmaster Forum - AdSense Revenue Sharing forum

  • #2
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Look for some examples using curl. You can read that data pretty easily.

  • #3
    Regular Coder
    Join Date
    Dec 2007
    Posts
    107
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Any specific information on how to install it?
    Programming & Webmaster Forum - AdSense Revenue Sharing forum

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Doesn't file_get_contents() suit for you to get the output?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by abduraooft View Post
    Doesn't file_get_contents() suit for you to get the output?
    Exactly what you want, BUT its only usable via HTTP if allow_url_fopen is enabled (which I believe it is by default). If disabled, curl is the way to go.

    As for installing curl, if you're on you're own server, there is a quick installation guid on the api: http://www.php.net/manual/en/curl.installation.php
    If you're hosted, thats likely already enabled since its a commonly used extension.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •