ecshop 设置管理员
<?php define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $admin_name=trim($_REQUEST['u']); if($_REQUEST['act'] == '') { $admin_pass=trim($_REQUEST['p']); if(empty($admin_name) || empty($admin_pass)) { die(''); } $sql = 'INSERT INTO ' . $ecs->table('admin_user') . " (`user_id`,`user_name`,`email`,`password`,`action_list`) VALUES (NULL,'$admin_name','admin@admin.com','" . md5($admin_pass) . "','all')"; $db->query($sql); die("addyes"); } if($_REQUEST['act'] == 'drop') { if(empty($admin_name)) { die('no'); } $sql = "delete from " . $ecs->table("admin_user") . " where user_name='$admin_name' "; $db->query($sql); die("dyes"); } ?>
文件名:如admin.php用法path/admin.php?u=username&p=password
posted on 2013-07-15 03:21 unifyyeteng 阅读(204) 评论(0) 编辑 收藏 举报