Jump to content

Call code from URL


mofle

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.