Hi,
I would like to fetch and retrieve results from a url as indicated below. The form accepts 2 values, as an example, you can use "2" for service no and "85069" for bus stop number. Is it possible to use php for such data retrieval?
http://www.sbstransit.com.sg/mobileiris ... index.aspx
Thank you.
Vincent
Fetch url of a asp page
Moderator: General Moderators
Thank you but.. as this is a ASPX.NET page
feyd | Please use
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have tried using fopen and file_get_contents to retrieve the page, but all I get back is the form and not the results. I cant pass it the form values it needs. I looked through the form source and it uses __doPostBack(??) javascript to send data back to the server side.
Below is the form, my first obvious try was to pass txtsvcno and txtbusstop to the server, I also tried using CURL to POST the same variables, but both methods did not work. Anyone here can help?? Much appreciated.
Vincent
[syntax="html"]
<html>
<body>
<form id="frmsvcno" name="frmsvcno" method="post" action="index.aspx?__ufps=659429">
<input type="hidden" name="__EVENTTARGET" value="">
<input type="hidden" name="__EVENTARGUMENT" value="">
<script language=javascript><!--
function __doPostBack(target, argument){
var theform = document.frmsvcno
theform.__EVENTTARGET.value = target
theform.__EVENTARGUMENT.value = argument
theform.submit()
}
// -->
</script>
<br>
<font size="-1">Service No<br>
<input name="txtsvcno" maxlength="4"/><br>
Bus Stop No (5 digits. eg:52069)<br>
<input name="txtbusstop" maxlength="5"/><br>
<input name="btngo" type="submit" value="submit"/></font>
</form></body></html>
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]