You need to put it in the [xcart]/admin/ directory. Make sure you put the following code at the top:
Code:
require "../smarty.php";
require "../config.php";
require "./auth.php";
require "../include/security.php";
The reason it redirects you to the admin login page is because you don't have admin authentication, most likely. Let me know if that works.