This article will introduce to you a good PHP file upload management system that requires login. The function is simple and students who need to know more can refer to it.
The code is as follows | Copy code |
$admin_pw="admin";// Management password $uploaddir="upload";//Upload directory session_start(); if($_GET['action']=="getcode") { setcode( ); exit(); } if($_POST['password']==$admin_pw && $_POST['yz']==$_SESSION['yzcode']) { $_SESSION['logined']=$admin_pw; } if($_GET['action']=="logout") { $_SESSION['logined' ]=""; header("location: ".$_SERVER['PHP_SELF']); exit(); } if($_SESSION['logined']!=$ admin_pw) { ?>
Please log in
< ;body>
|