SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to read out a response

    I have a problem with a link.

    In order to get information about a creditcard, a link is activated which gives a response-code. This response-code contains information I need to see if the creditcard and the payment was approved.

    The company sent me a test link to check if it works. The link works, but I can't figure out how to get the given response.

    I've tried file_get_contents($url);, but that gives an error. I've also tried fopen($url,'r');, but same error occurs.

    Can anyone help me?
    The link is:
    https://www.acrm.de/Posium/dispatche...ry=Netherlands

    Any help is appreciated!
    Jazz

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Is the response code coming from the url?
    if so just use $_GET (can't be that easy surely!)

    SpikeZ
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Guru MikeBigg's Avatar
    Join Date
    Jun 2004
    Location
    Reading, UK
    Posts
    970
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What errors are you seeing for file_get_contents and fopen?

    Also, can you post a code snippet of how you are using the functions.

    Mike

  4. #4
    SitePoint Guru MikeBigg's Avatar
    Join Date
    Jun 2004
    Location
    Reading, UK
    Posts
    970
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ
    Is the response code coming from the url?
    if so just use $_GET (can't be that easy surely!)
    If you look at the source of the page that the link gives, it looks like:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    
    msgnr=200&
    timestamp=20050211110000&
    trefnum=TEST&
    tracenr=000068&
    aid=64&
    rc=000&
    rcMessage=OK&
    blacklistRiskIndicator=00&
    binRiskIndicator=01&
    blzKtoRiskIndicator=&
    countryOfIssuer=GERMANY
    So the response is not in the $_GET.

    An fopen() should be able to read the text from that url and then parse it to grab the required info.

    Mike

  5. #5
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by MikeBigg
    If you look at the source of the page that the link gives, it looks like:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    
    msgnr=200&
    timestamp=20050211110000&
    trefnum=TEST&
    tracenr=000068&
    aid=64&
    rc=000&
    rcMessage=OK&
    blacklistRiskIndicator=00&
    binRiskIndicator=01&
    blzKtoRiskIndicator=&
    countryOfIssuer=GERMANY
    So the response is not in the $_GET.

    An fopen() should be able to read the text from that url and then parse it to grab the required info.

    Mike
    True, but is is also in the URL
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  6. #6
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The response is not in the URL... the used URL triggers the response...
    Like wrote, I've tried it with fopen() and with file_get_contents, but they both give this error:

    [function.file-get-contents]: failed to open stream: No such file or directory in d:\inetpub\wwwroot\mycomputer\test.php on line 9

    As you can see, the response-code isn't opened on my own pages... but, it's opened on the serverside of the www.acrm.de site. (see url)

    Is it maybe possible to trigger it in a iframe? (I have no idea, how to tackle this problem)

  7. #7
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    It is because you are connecting to https://
    May I direct you to this thread...
    http://www.sitepoint.com/forums/showthread.php?t=46651

    SpikeZ

    (Thought the site was yours, thats why I suggested the URL method) :|
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


Bookmarks

Posting Permissions

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