Fetch url of a asp page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vinooi
Forum Newbie
Posts: 2
Joined: Mon Apr 23, 2007 2:53 am

Fetch url of a asp page

Post by vinooi »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yes.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

are you saying you want to get the results from that page and display them from your server?

if so, have a look at file_get_contents() and preg_match().
vinooi
Forum Newbie
Posts: 2
Joined: Mon Apr 23, 2007 2:53 am

Thank you but.. as this is a ASPX.NET page

Post by vinooi »

feyd | Please use

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>&nbsp;&nbsp; 
	</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]
Post Reply