Code: Select all
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/Code: Select all
$search = array("http://rapidshare.com", "http://www.rapidshare.com", "www.rapidshare.com");Moderator: General Moderators
Code: Select all
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/Code: Select all
$search = array("http://rapidshare.com", "http://www.rapidshare.com", "www.rapidshare.com");If you comment out the lines I suggested earlier (the if(strpos($search, $link)) line and its corresponding closing bracket) what result do you get? Without those lines you can manually check the list to make sure it does contain rapidshare links.The_L wrote:Hmm it still does not list anything...
Can i insert an array here likeCode: Select all
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/
Code: Select all
$search = array("http://rapidshare.com", "http://www.rapidshare.com", "www.rapidshare.com");
Code: Select all
echo "<h2>Links present on page: ".$urlrun."</h2><br />";
// Loop to pump out the results
echo "<ul>";
// create an array of terms to find
$search = array('.rapidshare.com','http://rapidshare.com');
foreach ($linkarray as $links) {
foreach($links as $link) {
// loop through the search terms wit ha foreach
foreach($search as $search_term) {
// Comment out the next line to manually check the results
if(strpos($link, $search_term) > -1) { // Now matching $search_term instead of $search
// Leave the next line here
echo "<li>$link<li>";
// And comment out the next line
}
}
}
}
echo "</ul>";Code: Select all
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/Why have you commented that line out? You need to comment out the strpos line and its closing bracket, leaving the echo "<li>$link</li>" bit as it is. Everything else stays the same.The_L wrote:Ok there is something wrong...i commented this line:And it does not list anything...:/Code: Select all
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/
Code: Select all
$linkarray = $tspider->parse_array();
echo "<h2>Links present on page: ".$urlrun."</h2><br />";
// Loop to pump out the results
echo "<ul>";
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/
foreach ($linkarray as $links) {
foreach($links as $link) {
// if(strpos($link, $search) > -1) {
echo "<li>$link<li>";
// }
}
}
echo "</ul>";
exit;Code: Select all
<?php
//Make a title spider
$tspider = new tagSpider();
//Pass URL to the fetch page function
$tspider->fetchPage($urlrun);
// input box
$urlrun = $_POST['urlrun'];
if (!$urlrun) die("<form method='post'><input type='text' name='urlrun'> <input type='submit'></form>");
// Enter the tags into the parse array function
$linkarray = $tspider->parse_array();
echo "<h2>Links present on page: ".$urlrun."</h2><br />";
// Loop to pump out the results
echo "<ul>";
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/
foreach ($linkarray as $links) {
foreach($links as $link) {
// if(strpos($link, $search) > -1) {
echo "<li>$link<li>";
// }
}
}
echo "</ul>";
exit;Code: Select all
//Pass URL to the fetch page function
$tspider->fetchPage($urlrun);
// input box
$urlrun = $_POST['urlrun'];
if (!$urlrun) die("<form method='post'><input type='text' name='urlrun'> <input type='submit'></form>");Replace the <ul> and </ul> tags with <table> and </table> tags. If you want a header row, add something like this straight after the opening <table> tag:The_L wrote:How can i put the list in <table>? And how to remove those dots per line (in link listing)? So i can middle it and add some graphics...
Code: Select all
echo "<tr>
<th>Col1</th>
<th>Col2</th>
</tr>";Code: Select all
echo "<tr>
<td>$link</td>
<td>something else</td>
</tr>";Code: Select all
echo "<table align="center">";
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/
foreach ($linkarray as $links) {
foreach($links as $link) {
if(strpos($link, $search) > -1) {
echo "<tr>
<td>$link</td>
</tr>";
}
}
}
echo "</table>";
exit;You need to escape the "s in the first line, otherwise PHP thinks the string has ended after align=The_L wrote:What is wrong here??
Code: Select all
echo "<table align=\"center\">";Change your parse_array function so it returns $matching_data[0] instead, i.e.The_L wrote:aha..done but again something is wrong..there are two lists one below another...it double-listed the links
Code: Select all
return $matching_data[0];
Code: Select all
foreach ($linkarray as $links) {
if(strpos($link, $search) > -1) {
echo "<tr>
<td>$link</td>
</tr>";
}
}