This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dsn = 'mysql:host=localhost;dbname=MyShop'; | |
$username = 'root'; | |
$password = 'root'; | |
/* | |
//Option 1 - without using an error page | |
try { | |
$db = new PDO($dsn, $username, $password); | |
} catch (PDOException $e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background: url(images/bg.jpg) no-repeat center center fixed; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; | |
-o-background-size: cover; | |
background-size: cover; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `reg_users` ( | |
`user_id` int(11) NOT NULL, | |
`user_name` varchar(25) NOT NULL, | |
`user_email` varchar(60) NOT NULL, | |
`user_password` varchar(255) NOT NULL, | |
`joining_date` datetime NOT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Table structure for table `us_presidents` | |
-- | |
CREATE TABLE `us_presidents` ( | |
`president_id` int(3) NOT NULL, | |
`president_name` varchar(255) NOT NULL, | |
`more_info` varchar(255) NOT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function slug($text){ | |
// replace non letter or digits by - | |
$text = preg_replace('~[^pLd]+~u', '-', $text); | |
// trim | |
$text = trim($text, '-'); | |
// transliterate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('includes/db_connect.php'); | |
include 'includes/header.php'; | |
?> | |
<!-- Page Content --> | |
<body> | |
<div class="container"> <!--start container--> | |
<div class="row"><!--wrap both columns in a row--> | |
<div class="col-md-8"><!--blog entries column--> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Bootstrap4 Template for blogging</title> |