Initial commit
[2ch-be.git] / dev-test / old_dev / bak / rename.php
blob8533ece070e486dd5e5bda056e84ea8566212177
1 <?php
2 session_start();
3 // redirect to homepage if user is directly viewing this page
4 if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH']!='XMLHttpRequest' )){
5 header('location:index.php');
7 // Check if u_ is available
8 $substr = $_POST['name'].".dat";
9 $substr2 = substr($substr, 2);
10 $substr3 = substr($substr2, 0, -4);
11 if(preg_match("/u_/i", $substr)){
12 // sleep(5);
13 rename($_SESSION['sLoggedDir'] ."/".$substr, $_SESSION['sLoggedDir'] ."/".$substr2);
14 // header("Location: message.php?d={$substr3}");
15 }else{
16 // echo "(╯°□°)╯︵ ┻━┻";
17 header("Location: message.php?d=".substr($substr2, 0, -4));