Jump to content

Parse grab dynamic data


Agent_Stone

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.