Add files via upload

This commit is contained in:
wibyweb 2023-03-20 02:20:36 -04:00 committed by GitHub
parent 179f5da88b
commit 2072b5049f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,13 +41,29 @@
$status = "";
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);