Hi all, Ok, I've looked through the available answers and noone seems to answer this question nicely...
I want my PHP script to access data served by a 2nd server. Normally to access this data on server B (which I don't control) I have to fill in a form. What I want is for my script to simulate the form and POST the data to the CGI on server B, then parse the returned page for the data I want. I think I'll also have to change the http-referrer so the CGI on "B" thinks I'm using the form.
A brief explanation:
I just signed p for Barclays on-line banking and want my script to be able to read my current account balance and report it on my homepage. I'm aware that I need to be ultra-careful security-wise. All communications take place over SSL secured connections.
The data used to show the form in the 1st place:
<form method="POST" action="/fp/1_2c/online/1,
<input type=hidden name="action" value="Submit Membership Number">
<input type=hidden name="servlet" value="startlogin">
<input type=hidden name="screenName" value="logonMember1i">
<input type="text" size=25 maxlength=24 name="surname" title="Surname">
<input type="text" size=20 maxlength=24 name="membershipNo" title="Membership Number (last 8 digits)">
<input type=image src="newgreennext.gif" border=0 width=25 height=42 alt="Next" name="Next">
so I need to post the above data to https://ibank.barclays.co.uk/fp/1_2c/online/1,26806,,00.html
Any suggestions greatly appreciated.
I did wonder about the right & wrong issue of accessing the server this way, but as I can still only log-in with the correct information, I don't see this as being a problem