4
1
Fork 0
This repository has been archived on 2019-02-05. You can view files and clone it, but cannot push or open issues or pull requests.
Cheaterliste/insert.php

26 lines
554 B
PHP
Raw Normal View History

2017-03-29 19:00:22 +00:00
<?php
2017-04-08 09:20:41 +00:00
session_start();
$vac = "vac";
2017-03-29 19:00:22 +00:00
$host = "localhost";
$user = "vac";
$password = "hPUf8e4karnz61bS";
2017-03-29 19:00:22 +00:00
$conn = new mysqli($host,$user,$password,$vac);
2017-03-29 19:00:22 +00:00
if ($conn->connect_error){
die("Verbindung fehlgeschlagen: " . $conn->connect_error);
}
var_dump($_POST['url']);
2017-04-06 17:03:45 +00:00
if($_POST['url'] == ''){
2017-03-29 19:00:22 +00:00
header('Location: /');
return;
}
$url = $_POST['url'];
2017-04-06 17:03:45 +00:00
$author = $_SESSION['user'];
2017-03-29 19:00:22 +00:00
$sql = "INSERT INTO cheaterlist (url, author) VALUES('".$url."', '".$author."')";
2017-03-29 19:00:22 +00:00
$conn->query($sql);
?>
2017-04-08 09:20:41 +00:00
<meta http-equiv="refresh" content="0; url=/index.php" />