WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

Urgent Bootstrap Database Connection Error

TonyGuy

New member

0

0%

Status

Offline

Posts

27

Likes

0

Rep

0

Bits

145

3

Months of Service

0%
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::pARAM_STR);
$add->bindValue(":subtitle", $subtitle, PDO::pARAM_STR);
$add->bindValue(":description", $description, PDO::pARAM_STR);
$add->bindValue(":active", $active, PDO::pARAM_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/");
```
 

249

6,622

6,642

Top