kwhatcher Posted August 9, 2007 Share Posted August 9, 2007 I'm trying to create a script that will download html data from another page, extract the exact data I need and cat some data to it, then print it all. Here is what I got so far: <?php $webpage = "http://IP_ADDRESS_HERE/TEST/default.aspx?Varname1=VarValue&Varname2=VarValue"; $fp = fopen( $webpage, "r" ) or die("couldn't connect to report server"); while ( ! feof( $fp )) { print fgets( $fp, 1024 ); } ?> and that prints out: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head><title> Georgia Accident Report </title></head> <body> <form name="form1" method="post" action="default.aspx" id="form1"> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTUzOTgyNDMxMWQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFCldlYlZpZXdlcjG3PmqGD53aSbmRGAKfQZaZej4OOg==" /> <div title="Report Title"> <div id="WebViewer1"><font color="White"> <input name="WebViewer1ReportReceipt" type="hidden" value="ReportAssembly.rptMain;128311566960781250;1043106124"/><input name="WebViewer1ViewerType" type="hidden" value="AcrobatReader"/><DIV id="WebViewer1_controlDiv"> <!--IMPORTANT PART--> <iframe src="1219609430_135600530_1863198307_1251763558.ArCacheItem" style="width:100%;height:640px;"></iframe></DIV> <!--IMPORTANT PART END--> </font></div> </div> </form> </body> </html> I'm interested in the Iframe src. I need to somehow take out the value of the src and add http://IP_ADDRESS_HERE/TEST/ to the front of it for example print "<EMBED src=\"http://IP_ADDRESS_HERE/TEST/".$SrcValue."\" width=\"100%\" height=\"1000\" href=\"http://IP_ADDRESS_HERE/TEST/".$SrcValue."\"></EMBED>; Currently I'm using 3 levels of nested Iframes and it works but it looks really bad and there a way to many scroll bars. Thanks for any help any questions pleas email me at kwhatcher@gmail.com - Thanks again Kerry Hatcher Quote Link to comment https://forums.phpfreaks.com/topic/64127-getting-data-from-a-remote-file/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.