I'm having trouble adding a blog on the web page located at "https://mu19701017.xyz/proje/admin/pages/" and can't seem to process it into my database. I can't figure out where the mistake is. If anyone can help, I would be very grateful.
Username: admin
Password: 12345
Here is my code for adding a blog:
Blog Add | Panel
```php
if(@$_POST["submit"]){
$title = htmlspecialchars($_POST["title"], ENT_QUOTES, 'UTF-8');
$subtitle = htmlspecialchars($_POST["subtitle"], ENT_QUOTES, 'UTF-8');
$description = htmlspecialchars($_POST["description"], ENT_QUOTES, 'UTF-8');
$active = htmlspecialchars($_POST["active"], ENT_QUOTES, 'UTF-8');
$add = $db->prepare("INSERT INTO `blog`(`title`, `subtitle`, `description`, `active`) VALUES title, :subtitle, :description, :active)");
$add->bindValue(":title", $title, PDO:ARAM_STR);
$add->bindValue(":subtitle", $subtitle, PDO:ARAM_STR);
$add->bindValue(":description", $description, PDO:ARAM_STR);
$add->bindValue(":active", $active, PDO:ARAM_INT);
if($add->execute()) {
header("Location: blog.php?i=add");
} else {
header("Location: blog.php?i=error");
}
}
```
Add New
Title
Subtitle
Description
Status
Active
Inactive
Clear
```javascript
tinymce.init({
selector: '#mytextarea'
});
```
Here is my database connection code:
```php
header("Content-Type: text/html; charset=utf-8");
$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/");
```
Username: admin
Password: 12345
Here is my code for adding a blog:
Blog Add | Panel
```php
if(@$_POST["submit"]){
$title = htmlspecialchars($_POST["title"], ENT_QUOTES, 'UTF-8');
$subtitle = htmlspecialchars($_POST["subtitle"], ENT_QUOTES, 'UTF-8');
$description = htmlspecialchars($_POST["description"], ENT_QUOTES, 'UTF-8');
$active = htmlspecialchars($_POST["active"], ENT_QUOTES, 'UTF-8');
$add = $db->prepare("INSERT INTO `blog`(`title`, `subtitle`, `description`, `active`) VALUES title, :subtitle, :description, :active)");
$add->bindValue(":title", $title, PDO:ARAM_STR);
$add->bindValue(":subtitle", $subtitle, PDO:ARAM_STR);
$add->bindValue(":description", $description, PDO:ARAM_STR);
$add->bindValue(":active", $active, PDO:ARAM_INT);
if($add->execute()) {
header("Location: blog.php?i=add");
} else {
header("Location: blog.php?i=error");
}
}
```
Add New
Title
Subtitle
Description
Status
Active
Inactive
Clear
```javascript
tinymce.init({
selector: '#mytextarea'
});
```
Here is my database connection code:
```php
header("Content-Type: text/html; charset=utf-8");
$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/");
```