Page 6 of 8

Re: Php link exporter

Posted: Sat Nov 28, 2009 11:50 am
by The_L
Rotfl again empty list :/

Code: Select all

echo "<table align=\"center\">";
$search = 'http://rapidshare.com/'; // matches *.rapidshare.com/
foreach ($linkarray as $links) {
    if(strpos($link, $search) > -1) {
        echo "<tr>
           <td>$link</td>
           </tr>";
    }
}
echo "</table>";
exit;

Code: Select all

   preg_match_all($regex, $this->html, $matching_data); // match data between specificed tags 
    
    return $matching_data[0];
}

Re: Php link exporter

Posted: Sat Nov 28, 2009 11:54 am
by iankent
The_L wrote:Rotfl again empty list :/

Code: Select all

foreach ($linkarray as $links) {
$links should have been renamed $link

Re: Php link exporter

Posted: Sat Nov 28, 2009 12:01 pm
by The_L
it works..

Okay now can i remove "s from exported links as script prints them like "link" what to do to be just link...

And how to put input box in table so i can center it too? :P

Re: Php link exporter

Posted: Sat Nov 28, 2009 12:15 pm
by iankent
The_L wrote:it works..

Okay now can i remove "s from exported links as script prints them like "link" what to do to be just link..
You can either use

Code: Select all

$link = ltrim(rtrim($link,"\""), "\"");
or possibly if you change the result of parse_array to return $matching_data[1] instead that might clear it
The_L wrote:And how to put input box in table so i can center it too? :P
you shouldn't! put it inside a <div> and set text-align to center in CSS. using tables just for alignment isn't a good idea as they can be very unpredictable!

Re: Php link exporter

Posted: Sat Nov 28, 2009 2:03 pm
by The_L
Rotfl now it shows just on the end of the link xD

Re: Php link exporter

Posted: Sat Nov 28, 2009 2:17 pm
by iankent
The_L wrote:Rotfl now it shows just on the end of the link xD
what do you mean? the quote is still on the end? which one did you go with, changing the output of parse_array or using the ltrim() and rtrim() functions?

Re: Php link exporter

Posted: Sat Nov 28, 2009 5:56 pm
by The_L
I changed this

Code: Select all

return $matching_data[1];
yep just on the end..so its link"

Re: Php link exporter

Posted: Sat Nov 28, 2009 5:58 pm
by iankent
The_L wrote:I changed this

Code: Select all

return $matching_data[1];
yep just on the end..so its link"
hm, using:

Code: Select all

$link = rtrim($link, "\"");
inside the foreach loop should clear that

Re: Php link exporter

Posted: Sat Nov 28, 2009 6:21 pm
by The_L
It works...one more thing and i wont bother you :D

Is it possible to make "select all" button??? :P

Re: Php link exporter

Posted: Sat Nov 28, 2009 7:46 pm
by iankent
The_L wrote:It works...one more thing and i wont bother you :D

Is it possible to make "select all" button??? :P
what do you mean? what should it select all of?

Re: Php link exporter

Posted: Sat Nov 28, 2009 7:50 pm
by The_L
For example a "Select all" button that would select (and copy / if possible) the list of links...

Re: Php link exporter

Posted: Sat Nov 28, 2009 7:51 pm
by iankent
The_L wrote:For example a "Select all" button that would select (and copy / if possible) the list of links...
it'll depend on how you want to do it. are you going to give each link a checkbox? if so, then you can either add a link which redraws the whole page with the checkboxes ticked/unticked or you could use javascript to loop through and tick/untick them

what is it youre trying to do?

Re: Php link exporter

Posted: Sat Nov 28, 2009 8:01 pm
by The_L
Simple without any check boxes and ticks...just a button that selects all links and copy them...

Re: Php link exporter

Posted: Sun Nov 29, 2009 5:20 am
by The_L
Damn i cant insert an array...whatever i do i get some errors...:/

Code: Select all

echo "<h2>Links present on page: ".$urlrun."</h2><br />";
echo "<table align=\"center\" bordercolor=\"#006600\" bgcolor=\"#CCCCCC\">";
$search = array('.rapidshare.com','http://rapidshare.com');
foreach ($linkarray as $links) {
    foreach($links as $link) {
        foreach($search as $search_term) {
            if(strpos($link, $search_term) > -1) { // Now matching $search_term instead of $search
            $link = rtrim($link, "\"");
        <tr>
                 <td>$link</td>
  </tr>";
            }
        }
    }
}
echo "</table>";
Warning: Invalid argument supplied for foreach() in /nfs/c02/h10/mnt/30579/domains/forum-racunara.com/html/taggrab.php on line 100

Line 100 is :

Code: Select all

   foreach($links as $link) {

Re: Php link exporter

Posted: Sun Nov 29, 2009 7:01 am
by iankent
Not too sure, but you've cut off the echo " bit from from the very inside loop, that could be breaking it, i.e.

Code: Select all

$link = rtrim($link, "\"");
// echo " was missing here
echo "<tr>
    <td>$link</td>
</tr>";[/code