Jump to content

Archived

This topic is now archived and is closed to further replies.

Agent_Stone

Parse grab dynamic data

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.