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 Link to comment https://forums.phpfreaks.com/topic/99765-call-code-from-url/ 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. Link to comment https://forums.phpfreaks.com/topic/99765-call-code-from-url/#findComment-510242 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? Link to comment https://forums.phpfreaks.com/topic/99765-call-code-from-url/#findComment-510243 Share on other sites More sharing options...
maexus Posted April 5, 2008 Share Posted April 5, 2008 Run it in a cron job? Link to comment https://forums.phpfreaks.com/topic/99765-call-code-from-url/#findComment-510245 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); Link to comment https://forums.phpfreaks.com/topic/99765-call-code-from-url/#findComment-510251 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.