mill Posted June 29, 2008 Share Posted June 29, 2008 I need some info on how to start this project im working on I know some basic or php just looking for someone to help out I need to use the fopen and maybe strip_tag to do this and i dont know where to start... I need to open a webpage take some information from it and insert it in to a data base...ie if you go to page "http://www.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Azeroth&PlayerName=Dayvinn-" and look in the left corner I need to get like the wins / losses and have them added to a data base with his username any ideas? Link to comment https://forums.phpfreaks.com/topic/112474-help-with-php/ Share on other sites More sharing options...
DarkWater Posted June 29, 2008 Share Posted June 29, 2008 Use file_get_contents() to get the HTML output, then use a regex to get the wins and losses. Link to comment https://forums.phpfreaks.com/topic/112474-help-with-php/#findComment-577487 Share on other sites More sharing options...
mill Posted June 29, 2008 Author Share Posted June 29, 2008 <?php $text = file_get_contents("http://www.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Azeroth&PlayerName=Dayvinn-"); if (preg_match("/Undead/", $text, $matches)) { echo "Match was found <br />"; echo $matches[0]; } ?> Thats my code to start testing it and it does work and does find it, how would i search for Undea: Then take the numbers after it in the string? Undead: 39 36 52.00 is how it shows up i need to take the 39 36 and 52.00 Link to comment https://forums.phpfreaks.com/topic/112474-help-with-php/#findComment-577490 Share on other sites More sharing options...
thatsgreat2345 Posted June 29, 2008 Share Posted June 29, 2008 You will most likely need to use some regular expressions. You will need to view the HTML source to make your expressions. If you have trouble making them as they could be quite difficult depending on how the information is being displayed then I'd recommend post some of the HTML in the regex section of phpfreaks. Link to comment https://forums.phpfreaks.com/topic/112474-help-with-php/#findComment-577494 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.