kullaıcı adı: admin
şifre: 12345
blog ekleme kodum
Blog Ekle | Panel
if(@$_POST["submit"]){
$baslik = htmlspecialchars($_POST["baslik"], ENT_QUOTES, 'UTF-8');
$alt_baslik = htmlspecialchars($_POST["alt_baslik"], ENT_QUOTES, 'UTF-8');
$aciklama = htmlspecialchars($_POST["aciklama"], ENT_QUOTES, 'UTF-8');
$aktif = htmlspecialchars($_POST["aktif"], ENT_QUOTES, 'UTF-8');
$ekle = $db -> prepare("INSERT INTO `blog`(`baslik`, `alt_baslik`, `aciklama`, `aktif`) VALUES
(:baslik, :alt_baslik, :aciklama, :aktif)");
$ekle -> bindValue(":baslik",$baslik, PDO::PARAM_STR);
$ekle -> bindValue(":alt_baslik", $alt_baslik, PDO::PARAM_STR);
$ekle -> bindValue(":aciklama", $aciklama, PDO::PARAM_STR);
$ekle -> bindValue(":aktif", $aktif, PDO::PARAM_INT);
if($ekle -> execute()) {
header("Location: blog.php?i=ekle");
} else{
//print_r($ekle-> errorInfo()); hata varsa ekrana bastirir
header("Location: blog.php?i=hata");
}
}
?>
<script></script>
<script></script>
<script></script>
<script></script>
<script></script>
<script>
tinymce.init({
selector: '#mytextarea'
});
</script>
veri tabanı bağlantı kodum.
header("Content-Type: text/html; charset= utf-8");
//error_reporting(0);
setlocale(LC_ALL, 'tr_Tr.UTF-8', 'tr_Tr', 'tr','turkish');
$DBhost ="localhost";
$DBuser ="medine";
$DBpass ="Medine356*";
$DBname ="proje";
try{
$db = new PDO("mysql:host=$DBhost; port:3306; dbname= $DBname",$DBuser, $DBpass);
$db ->exec("SET NAMES'utf8'; SET CHARSET'utf8'");
}catch(PDOException $e) {
echo $e -> getMessage();
}
define("_URL","http://localhost/proje/");
?>