/**
 * restores to a named r2s state if it exists
 *
 * the list of r2s's allow you to associate a name to an r2sid, for ex.
 * every time you list invoices a new r2s is made, if an error say occurs
 * when processing the selected invoices you can just click the link to
 * go back to the exact same listing.
 *
 * @param string $name r2s name
 */
function r2sListRestore($name)
{
    if (($r2sid = r2sListCheck($name)) !== false) {
        r2s_return($r2sid);
    }
}
<?php

require "settings.php";
if (isset($_REQUEST["r2sid"])) {
    r2s_return($_REQUEST["r2sid"]);
}
header("Location: main.php");
exit;