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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.