-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.php
More file actions
40 lines (29 loc) · 923 Bytes
/
save.php
File metadata and controls
40 lines (29 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/*
(c) 2006 Reed Morse <firstname.lastname at gmail.com>
and Pau Santesmasses <firstname at lastname.net>
*/
require("functions.php");
require("configuration.php");
connect();
authenticate();
$id = $_GET['id'];
foreach($_POST as $key => $value){ // Thanks Tynan Smith!
$key .= "=";
$value .= "&";
$string .= $key.$value;
}
$string = ereg_replace("newURL=", "", $string);
$string = ereg_replace("&_=&", "", $string);
$newURL = $string;
$query_update = "UPDATE `".$main_table."` SET `target`='".$newURL."', `day`='".date('j')."', `month`='".date('n')."', `year`='".date('Y')."' WHERE `id`='".$id."'";
mysql_query($query_update);
$query_confirm = "SELECT * FROM `".$main_table."` WHERE `target`='".$newURL."'";
$result_confirm = mysql_query($query_confirm);
$num_rows = @mysql_num_rows($result_confirm);
if($num_rows !== "" && $num_rows !== "0"){
echo 'success';
} else {
echo 'failure';
}
?>