Slim Framework is Micro Framework Similer to core php base. The Slim Framework doesn't have database functionality by default so you can just use core php for that. And if you do not know how that works Follow Some code.
Image Upload
Image Upload Session Authentication:
Image Upload
$app->get("/upload", function () use ($app) {
$app->view()->setData('username', null);
$app->render('upload.php');
});
$app->view()->setData('username', null);
$app->render('upload.php');
});
Image Upload Session Authentication:
$app->post("/upload",function () use ($app){
if(isset($_POST['submit']))
{
//$app->request()->$_FILES['picture']['name'];
echo $_FILES['picture']['name'];
echo $_FILES['picture']['size'];
$tmpname = $_FILES['picture']['tmp_name'];
$_SESSION['name'] = "img/".$_FILES['picture']['name'];
move_uploaded_file($tmpname,$_SESSION['name'] );
$uploaddir="/xampp/htdocs/OAuth/Slim/assets/img";
echo '<img src="'.$_SESSION['name'].'">';
}
});
if(isset($_POST['submit']))
{
//$app->request()->$_FILES['picture']['name'];
echo $_FILES['picture']['name'];
echo $_FILES['picture']['size'];
$tmpname = $_FILES['picture']['tmp_name'];
$_SESSION['name'] = "img/".$_FILES['picture']['name'];
move_uploaded_file($tmpname,$_SESSION['name'] );
$uploaddir="/xampp/htdocs/OAuth/Slim/assets/img";
echo '<img src="'.$_SESSION['name'].'">';
}
});