Add files via upload
This commit is contained in:
parent
724515a9fe
commit
8d73643940
2 changed files with 11 additions and 7 deletions
|
@ -78,7 +78,7 @@
|
|||
<textarea id="enable" name="enable"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label for="updatable">updatable (0 for no, or integer value 1-6, 1 is default):</label>
|
||||
<label for="updatable">updatable (0 for no, or integer value 1-6):</label>
|
||||
|
||||
<textarea id="updatable" name="updatable"></textarea>
|
||||
</div>
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
|
||||
$url = mysqli_real_escape_string($link, $_POST['url']);
|
||||
$url = str_replace("''", "%27", $url);
|
||||
$url_noprefix = str_ireplace("http://","", $url);
|
||||
$url_noprefix = str_ireplace("https://","", $url);
|
||||
$url_noprefix = str_ireplace("http://www.","", $url);
|
||||
$url_noprefix = str_ireplace("https://www.","", $url);
|
||||
$title = mysqli_real_escape_string($link, $_POST['title']);
|
||||
$tags = mysqli_real_escape_string($link, $_POST['tags']);
|
||||
$description = mysqli_real_escape_string($link, $_POST['description']);
|
||||
|
@ -49,8 +53,8 @@
|
|||
$shard = mysqli_real_escape_string($link, $_POST['shard']);
|
||||
|
||||
if($shard == ""){
|
||||
$sql = "INSERT INTO windex (url,title,tags,description,body,http,surprise,worksafe,enable,updatable,approver)
|
||||
VALUES ('".$url."','".$title."','".$tags."','".$description."','".$body."','".$http."','".$surprise."','".$worksafe."','".$enable."','".$updatable."','".$_SESSION["user"]."')";
|
||||
$sql = "INSERT INTO windex (url,url_noprefix,title,tags,description,body,http,surprise,worksafe,enable,updatable,date,approver)
|
||||
VALUES ('".$url."','".$url_noprefix."','".$title."','".$tags."','".$description."','".$body."','".$http."','".$surprise."','".$worksafe."','".$enable."','".$updatable."',now(),'".$_SESSION["user"]."')";
|
||||
if (!mysqli_query($link, $sql))
|
||||
{
|
||||
$error = 'Error fetching index: ' . mysqli_error($link);
|
||||
|
@ -58,8 +62,8 @@
|
|||
exit();
|
||||
}
|
||||
}else{
|
||||
$sql = "INSERT INTO windex (url,title,tags,description,body,http,surprise,worksafe,enable,updatable,shard,approver)
|
||||
VALUES ('".$url."','".$title."','".$tags."','".$description."','".$body."','".$http."','".$surprise."','".$worksafe."','".$enable."','".$updatable."','".$shard."','".$_SESSION["user"]."')";
|
||||
$sql = "INSERT INTO windex (url,url_noprefix,title,tags,description,body,http,surprise,worksafe,enable,updatable,date,shard,approver)
|
||||
VALUES ('".$url."','".$url_noprefix."','".$title."','".$tags."','".$description."','".$body."','".$http."','".$surprise."','".$worksafe."','".$enable."','".$updatable."',now(),'".$shard."','".$_SESSION["user"]."')";
|
||||
if (!mysqli_query($link, $sql))
|
||||
{
|
||||
$error = 'Error fetching index: ' . mysqli_error($link);
|
||||
|
@ -80,8 +84,8 @@
|
|||
}
|
||||
$id = $idArray[0];
|
||||
|
||||
$sql = "INSERT INTO ws$shard (id,url,title,tags,description,body,http,surprise,worksafe,enable,updatable,shard,approver)
|
||||
VALUES ('".$id."','".$url."','".$title."','".$tags."','".$description."','".$body."','".$http."','".$surprise."','".$worksafe."','".$enable."','".$updatable."','".$shard."','".$_SESSION["user"]."')";
|
||||
$sql = "INSERT INTO ws$shard (id,url,url_noprefix,title,tags,description,body,http,surprise,worksafe,enable,updatable,date,shard,approver)
|
||||
VALUES ('".$id."','".$url."','".$url_noprefix."','".$title."','".$tags."','".$description."','".$body."','".$http."','".$surprise."','".$worksafe."','".$enable."','".$updatable."',now(),'".$shard."','".$_SESSION["user"]."')";
|
||||
if (!mysqli_query($link, $sql))
|
||||
{
|
||||
$error = 'Error fetching index: ' . mysqli_error($link);
|
||||
|
|
Loading…
Add table
Reference in a new issue