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 | |
class db { | |
protected $connection; | |
protected $query; | |
protected $show_errors = TRUE; | |
protected $query_closed = TRUE; | |
public $query_count = 0; | |
public function __construct($dbhost = 'localhost', $dbuser = 'root', $dbpass = '', $dbname = '', $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 | |
$host = 'localhost'; | |
$user = ''; | |
$password = ''; | |
$dbname = 'dbname'; | |
// Set DSN | |
$dsn = 'mysql:host='. $host .';dbname='. $dbname; | |
// Create a PDO instance |
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 | |
// Database | |
include('config/db.php'); | |
// Set session | |
session_start(); | |
if(isset($_POST['records-limit'])){ | |
$_SESSION['records-limit'] = $_POST['records-limit']; | |
} | |
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
// vim: syntax=javascript | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Bootstrap CSS --> |
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
// vim: syntax=jquery | |
$(document).ready(function() { | |
$('#submit').click(function() { | |
var text = $('a').prop('text'); | |
alert(text); | |
}) | |
}); | |
$(document).ready(function() { |
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
let messages = ["Here", "are", "some", "messages."]; | |
let delay = 1000; | |
let header = document.getElementById("message"); | |
messages.forEach(function(message, i) { | |
setTimeout(function() { | |
header.innerText = message; | |
}, delay * i); | |
}); |
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
public function strConvert($string) { | |
$pat = array('/#(\w+)/', '/@(\w+)/'); | |
$rep = array('<span class="font-weight-bold text-info">#$1</span>', '<span class="font-weight-bold text-info">@$1</span>'); | |
return preg_replace($pat, $rep, $string); | |
} |
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 | |
$response = ''; | |
if (isset($_POST['email'], $_POST['subject'], $_POST['name'], $_POST['msg'])) { | |
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { | |
$response = 'Email is not valid!'; | |
} else if (empty($_POST['email']) || empty($_POST['subject']) || empty($_POST['name']) || empty($_POST['msg'])) { | |
$response = '<div class="alert alert-warning alert-dismissible fade show" role="alert">Please complete all fields!<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'; | |
} else { | |
$to = '[email protected]'; | |
$from = $_POST['email']; |
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.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<link rel="stylesheet" href="style.css" /> | |
<title>Modal window</title> | |
</head> | |
<body> |
OlderNewer