TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-14-2008, 08:35 PM   #1 (permalink)
The Contributor
 
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
h0ly lag is on a distinguished road
Default Rapidshare link checker

I've made a RS link checker, but I feel it's very inefficient in the way it checks the links. It uses get_file_contents to visit the page of every link, then using some (albeit very terrible or misused) regex. I am posting my code for some input from anyone who is willing to give it. As far as making it more efficient, adding more features or anything else. Yes, it is trusting user input as of right now. I suppose this was just prof of concept. Please only constructive criticism.

PHP Code:
<?php

if (!isset($_POST['link_set']))
    {
    echo 
'
    <form action="" method="post">
    <textarea name="link_set" rows="15" cols="80"></textarea><br /><br />
    <input type="submit" value="Submit" />
    </form>'
;
    }
elseif (empty(
$_POST['link_set']))
    {
    echo 
'ERROR: No links entered.';
    }
else
    {
    
$link_set explode("\n",$_POST['link_set']);
    foreach (
$link_set as $link)
        {
        
$link_str file_get_contents($link);
        
$pattern '<input type="hidden" name="dl.start" value="PREMIUM" />';
        
        
preg_match($pattern,$link_str,$match);
        
        if (
$match[0] != null)
            {
            echo 
'<span style="color: green">'.$link.'</span><br />';
            }
        else
            {
            echo 
'<span style="color: red">'.$link.'</span><br />';
            }
        }
    echo 
'<br /><input type="button" value="Check More Links" onClick="window.location.href=window.location.href">';
    }

?>
__________________

Last edited by h0ly lag : 11-15-2008 at 06:19 AM.
Send a message via AIM to h0ly lag Send a message via MSN to h0ly lag
h0ly lag is offline  
Reply With Quote
Old 11-18-2008, 06:18 PM   #2 (permalink)
The Contributor
 
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
h0ly lag is on a distinguished road
Default

Nobody has anything to say?
__________________
Send a message via AIM to h0ly lag Send a message via MSN to h0ly lag
h0ly lag is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:38 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design