Agent_Stone Posted March 6, 2006 Share Posted March 6, 2006 I need some help making a script to grab a webpage and only select a certain area of the site.Address I want to parse [a href=\"http://aaotracker.4players.de/clanprofile.php?clanid=24983\" target=\"_blank\"]http://aaotracker.4players.de/clanprofile.php?clanid=24983[/a]Here is am image of what I want to grab and post. [a href=\"http://img64.imageshack.us/my.php?image=parsestats1fc.jpg\" target=\"_blank\"][img src=\"http://img64.imageshack.us/img64/9519/parsestats1fc.th.jpg\" border=\"0\" alt=\"IPB Image\" /][/a]Plz help I ont know ho to parse it but can create a apge that shows the exact page. Quote Link to comment https://forums.phpfreaks.com/topic/4229-parse-grab-dynamic-data/ Share on other sites More sharing options...
craygo Posted March 6, 2006 Share Posted March 6, 2006 Where is the clanid coming from?? have you made a page that lists the clans. if not then here is something that will list the clans[code]<?$sql = "SELECT clanid, clanname FROM tablename"; $result = mysql_query($sql) or die (mysql_error()); while($rows = mysql_fetch_array($result)){print 'Stats for clan <a href="http://aaotracker.4players.de/clanprofile.php?clanid='.$rows['clanid'].'">'.$rows['clanname'].'</a><br>';}?>[/code]and the clanprofile.php page will be the template[code]<?$clanid = $_GET['clanid'];$sql = "SELECT clanid, clanname FROM tablename WHERE clanid = "$clanid""; $result = mysql_query($sql) or die (mysql_error()); while($rows = mysql_fetch_array($result)){print '<tr><td>Clan Name</td><td>'.$rows['clanname'].'</td></tr>';}?>[/code]Just remember this is a loop so anything you do not want to print in the loop will have to go before the "while" statement. Like field headers and such.Ray Quote Link to comment https://forums.phpfreaks.com/topic/4229-parse-grab-dynamic-data/#findComment-14694 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.