mofle Posted April 5, 2008 Share Posted April 5, 2008 I have this code: //Forces a recheck of every torrent //Way number two (faster) $utorrent = new uTorrent(); $torrents = array(); //collects an array containing every hash foreach($utorrent->getTorrents() as $torrent) { $torrents[] = $torrent[uTORRENT_TORRENT_HASH]; } //rechecks every torrent $utorrent->recheck($torrents); How can i make it run when i click on a link? <a href=" ??? ">Link</a> Thanks for your help Quote Link to comment Share on other sites More sharing options...
maexus Posted April 5, 2008 Share Posted April 5, 2008 Save it into a php file and link to the file? As soon as the php is called, it's ran. Quote Link to comment Share on other sites More sharing options...
mofle Posted April 5, 2008 Author Share Posted April 5, 2008 Yes i know that's a possibility. What I'm asking; is there another way of doing this? Quote Link to comment Share on other sites More sharing options...
maexus Posted April 5, 2008 Share Posted April 5, 2008 Run it in a cron job? Quote Link to comment Share on other sites More sharing options...
mofle Posted April 5, 2008 Author Share Posted April 5, 2008 No, something more like this: <a href="?action=recheckall">Recheck all</a> if ($_GET["action"]=="recheckall") //Forces a recheck of every torrent //Way number two (faster) $utorrent = new uTorrent(); $torrents = array(); //collects an array containing every hash foreach($utorrent->getTorrents() as $torrent) { $torrents[] = $torrent[uTORRENT_TORRENT_HASH]; } //rechecks every torrent $utorrent->recheck($torrents); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.