fopen

Discussion in 'PHP' started by ziya, Jun 20, 2007.

  1. #1
    Hello ,

    After user pressing the button send
    I want to open url from myscript. But i want that url to be open on background. I mean after i open that url, i will insert , uptdate my tables, and after all stuff will redirect user to the same page .

    I use procedure fopen :

    fopen("http://www.example.com/api/example.html?api_id=example39R&api_pwd=example&txt= 855&dest=11111111&tag=example
    ", 'r');

    i just changed real link to example. when i call it from browser ( address bar) it works fine.
    But when i call fopen from my script , it doesnt give any error, but it seems the link wasnt called too.

    Please can you help me in this case ?

    Regards,
    Ziya
     
    ziya, Jun 20, 2007 IP
  2. UnrealEd

    UnrealEd Peon

    Messages:
    148
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i think the allow_url_fopen setting is set to off. If the setting is set to off, you will only be able to open pages on your server.

    Since no error is returned, you should also check the error_reporting. Probably this is set to display nothing to the users, but when debugging your code it's very important to see them. Just place the following lines on top of your code:
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    PHP:
    this modifies the php.ini settings when loading the page (these modifications are only temporary: when the page is done parsing, the php.ini settings are used again)
     
    UnrealEd, Jun 21, 2007 IP
  3. ziya

    ziya Well-Known Member

    Messages:
    1,971
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Thank you for your reply. I did as you told me , and i found the error. Now i had fixed ti, it works fine. :)

    Regards,
    Ziya
     
    ziya, Jun 21, 2007 IP