tass2001 Posted December 13, 2007 Share Posted December 13, 2007 I keep getting errors from this script, can anyone tell what i'm missing? <?PHP $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $LOGINURL = "http://www.myspace.com/imparanoid000"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); $result = curl_exec($ch); curl_close($ch); preg_match_all(#<tr>[^<]*?<td[^>]*?>[^<]*?<a href="([^"]*?)">([^<]*?)</a>[^<]*?<br>[^<]*?<br>[^<]*?<a[^>]*?>[^<]*<img src="([^"]*?)"[^>]*?>[^<]*?</a>.*?</td>[^<]*?<td[^>]*?>[^<]*<span[^>]*?>([^<]*?)</span>[^<]*<br>[^<]*<br>(.*?)</td>[^<]*?</tr>#is, $sConents); echo $sContents; ?> Link to comment https://forums.phpfreaks.com/topic/81449-preg-problem/ Share on other sites More sharing options...
peranha Posted December 13, 2007 Share Posted December 13, 2007 you have echo $sContents, and it the line before it it is sConents Link to comment https://forums.phpfreaks.com/topic/81449-preg-problem/#findComment-413488 Share on other sites More sharing options...
tass2001 Posted December 13, 2007 Author Share Posted December 13, 2007 Whoops let me see now if it works Link to comment https://forums.phpfreaks.com/topic/81449-preg-problem/#findComment-413489 Share on other sites More sharing options...
tass2001 Posted December 13, 2007 Author Share Posted December 13, 2007 Hmm I keep getting Parse error: syntax error, unexpected ';' Expecting ')' in Comment.php on line 15 Link to comment https://forums.phpfreaks.com/topic/81449-preg-problem/#findComment-413493 Share on other sites More sharing options...
peranha Posted December 13, 2007 Share Posted December 13, 2007 Is this your comment.php page, or is that page somewhere else? Link to comment https://forums.phpfreaks.com/topic/81449-preg-problem/#findComment-413496 Share on other sites More sharing options...
tass2001 Posted December 13, 2007 Author Share Posted December 13, 2007 No, this is my comment.php page, it a script made to just get comments from a myspace profile using PCRE Link to comment https://forums.phpfreaks.com/topic/81449-preg-problem/#findComment-413505 Share on other sites More sharing options...
rajivgonsalves Posted December 13, 2007 Share Posted December 13, 2007 this preg_match_all(#<tr>[^<]*?<td[^>]*?>[^<]*?<a href="([^"]*?)">([^<]*?)</a>[^<]*?<br>[^<]*?<br>[^<]*?<a[^>]*?>[^<]*<img src="([^"]*?)"[^>]*?>[^<]*?</a>.*?</td>[^<]*?<td[^>]*?>[^<]*<span[^>]*?>([^<]*?)</span>[^<]*<br>[^<]*<br>(.*?)</td>[^<]*?</tr>#is, $sConents); has to be preg_match_all("#<tr>[^<]*?<td[^>]*?>[^<]*?<a href="([^"]*?)">([^<]*?)</a>[^<]*?<br>[^<]*?<br>[^<]*?<a[^>]*?>[^<]*<img src="([^"]*?)"[^>]*?>[^<]*?</a>.*?</td>[^<]*?<td[^>]*?>[^<]*<span[^>]*?>([^<]*?)</span>[^<]*<br>[^<]*<br>(.*?)</td>[^<]*?</tr>#is", $results, $sContents); notice the quotes also you have to add $results, and it should not be print $sContents it should be print_r($sContents) hope its helpful Link to comment https://forums.phpfreaks.com/topic/81449-preg-problem/#findComment-413542 Share on other sites More sharing options...
tass2001 Posted December 13, 2007 Author Share Posted December 13, 2007 That helped but now i'm getting an "HTTP 500 Unknown Server error" ??? Link to comment https://forums.phpfreaks.com/topic/81449-preg-problem/#findComment-414116 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.