5
1
Fork 0
mirror of https://github.com/Anvilcraft/jensmemes synced 2024-11-25 18:12:33 +01:00
jensmemes/website/sqlimporter.php
2020-07-25 11:36:45 +02:00

33 lines
580 B
PHP

<!DOCTYPE html>
<html>
<head>
<title>SQL Script</title>
</head>
<body>
<h1>SQL importer</h1>
<form method="post" action="#">
<input type="submit" name="submit" value="Start">
</form>
<?php
if(isset($_POST['submit'])){
include('dbcon.php');
$files = glob('images/*/*', GLOB_BRACE);
foreach ($files as $file) {
$stmt = "INSERT INTO images(user,path, cat) VALUES ('System', '$file', 'jens')";
$result = mysqli_query($con, $stmt);
if($result){
echo "<b>IMG STORED: </b>".$file.'<br>';
}
}
}
?>
</body>
</html>