PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
The_L
Forum Commoner
Posts: 64 Joined: Sun Nov 22, 2009 6:53 pm
Post
by The_L » Sat Nov 28, 2009 11:50 am
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];
}
iankent
Forum Contributor
Posts: 333 Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom
Post
by iankent » Sat Nov 28, 2009 11:54 am
The_L wrote: Rotfl again empty list :/
$links should have been renamed $link
The_L
Forum Commoner
Posts: 64 Joined: Sun Nov 22, 2009 6:53 pm
Post
by The_L » Sat Nov 28, 2009 12:01 pm
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?
iankent
Forum Contributor
Posts: 333 Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom
Post
by iankent » Sat Nov 28, 2009 12:15 pm
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?
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!
The_L
Forum Commoner
Posts: 64 Joined: Sun Nov 22, 2009 6:53 pm
Post
by The_L » Sat Nov 28, 2009 2:03 pm
Rotfl now it shows just on the end of the link xD
iankent
Forum Contributor
Posts: 333 Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom
Post
by iankent » Sat Nov 28, 2009 2:17 pm
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?
The_L
Forum Commoner
Posts: 64 Joined: Sun Nov 22, 2009 6:53 pm
Post
by The_L » Sat Nov 28, 2009 5:56 pm
I changed this
yep just on the end..so its link"
iankent
Forum Contributor
Posts: 333 Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom
Post
by iankent » Sat Nov 28, 2009 5:58 pm
The_L wrote: I changed this
yep just on the end..so its link"
hm, using:
inside the foreach loop should clear that
The_L
Forum Commoner
Posts: 64 Joined: Sun Nov 22, 2009 6:53 pm
Post
by The_L » Sat Nov 28, 2009 6:21 pm
It works...one more thing and i wont bother you
Is it possible to make "select all" button???
iankent
Forum Contributor
Posts: 333 Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom
Post
by iankent » Sat Nov 28, 2009 7:46 pm
The_L wrote: It works...one more thing and i wont bother you
Is it possible to make "select all" button???
what do you mean? what should it select all of?
The_L
Forum Commoner
Posts: 64 Joined: Sun Nov 22, 2009 6:53 pm
Post
by The_L » Sat Nov 28, 2009 7:50 pm
For example a "Select all" button that would select (and copy / if possible) the list of links...
iankent
Forum Contributor
Posts: 333 Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom
Post
by iankent » Sat Nov 28, 2009 7:51 pm
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?
The_L
Forum Commoner
Posts: 64 Joined: Sun Nov 22, 2009 6:53 pm
Post
by The_L » Sat Nov 28, 2009 8:01 pm
Simple without any check boxes and ticks...just a button that selects all links and copy them...
The_L
Forum Commoner
Posts: 64 Joined: Sun Nov 22, 2009 6:53 pm
Post
by The_L » Sun Nov 29, 2009 5:20 am
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 :
iankent
Forum Contributor
Posts: 333 Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom
Post
by iankent » Sun Nov 29, 2009 7:01 am
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