Add files via upload
This commit is contained in:
parent
179f5da88b
commit
2072b5049f
1 changed files with 34 additions and 4 deletions
|
@ -43,11 +43,27 @@
|
|||
if( isset($_POST['tags']))
|
||||
{
|
||||
$tags = mysqli_real_escape_string($link, $_POST['tags']);
|
||||
|
||||
$result = mysqli_query($link,"SELECT id, shard FROM windex WHERE url = '".$url."'");
|
||||
if ($result === false)
|
||||
{
|
||||
$error = 'Error: ' . mysqli_error($link);
|
||||
include 'error.html.php';
|
||||
exit();
|
||||
}
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
$idArray[] = $row['id'];
|
||||
$shardArray[] = $row['shard'];
|
||||
}
|
||||
$id = $idArray[0];
|
||||
$shard = $shardArray[0];
|
||||
|
||||
if($tags==""){
|
||||
$result = mysqli_query($link,"UPDATE windex SET tags = NULL WHERE url = '".$url."';");
|
||||
$result = mysqli_query($link,"UPDATE windex SET tags = NULL WHERE id = $id AND url = '".$url."'");
|
||||
}
|
||||
else{
|
||||
$result = mysqli_query($link,"UPDATE windex SET tags = '".$tags."' WHERE url = '".$url."';");
|
||||
$result = mysqli_query($link,"UPDATE windex SET tags = '".$tags."' WHERE id = $id AND url = '".$url."'");
|
||||
}
|
||||
if ($result === false)
|
||||
{
|
||||
|
@ -55,11 +71,25 @@
|
|||
include 'error.html.php';
|
||||
exit();
|
||||
}
|
||||
|
||||
if($tags==""){
|
||||
$result = mysqli_query($link,"UPDATE ws$shard SET tags = NULL WHERE id = $id AND url = '".$url."'");
|
||||
}
|
||||
else{
|
||||
$result = mysqli_query($link,"UPDATE ws$shard SET tags = '".$tags."' WHERE id = $id AND url = '".$url."'");
|
||||
}
|
||||
if ($result === false)
|
||||
{
|
||||
$error = 'Error fetching index: ' . mysqli_error($link);
|
||||
include 'error.html.php';
|
||||
exit();
|
||||
}
|
||||
|
||||
$status = "Update Completed";
|
||||
unset($_POST['tags']);
|
||||
}
|
||||
|
||||
$result = mysqli_query($link,"SELECT tags FROM windex WHERE url = '".$url."';");
|
||||
$result = mysqli_query($link,"SELECT tags FROM windex WHERE url = '".$url."'");
|
||||
if ($result === false)
|
||||
{
|
||||
$error = 'Error fetching index: ' . mysqli_error($link);
|
||||
|
|
Loading…
Reference in a new issue