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
sudo mysql -u root | |
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'test'; |
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 | |
namespace App\Http\Middleware; | |
use Closure; | |
class QueryLog | |
{ | |
/** | |
* Handle an incoming request. |
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
user_email.trim().length==0 || user_email.match(/^[\w!#$%&\'*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/i) == null |
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 | |
include 'conn.php'; | |
include 'helper.php'; | |
include 'and_many_more.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
<?php | |
// connect to database | |
$con = mysqli_connect('host', 'user', 'password', 'db_name'); | |
// check for connection errors | |
if(mysqli_connect_errno()) | |
die(mysqli_connect_error()); | |
// function to execute query and automatically check for errors | |
function query($sql){ |
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 include_once 'helper/helper.php'; ?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>My Website</title> |
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 subview($file){ | |
$file = __DIR__.'/../views/sub-views/'.$file; | |
include $file; | |
} |
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 http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>My Website</title> | |
</head> |
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
$(document).ready(function(){ | |
// invoke function when form is submit | |
$("#form-name").submit(function(e){ | |
// select all the input fields with form-validate class and loop over them | |
$(".form-validate").each(function () { | |
// check if the the form is empty/filled with spaces | |
if($(this).val().trim().length == 0){ | |
// get the respective data-validation-error | |
var errorMessage = $(this).attr('data-validation-error'); | |
// show the error message somehow |
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
... | |
<div class="form-group"> | |
<input type="text" class="form-control form-validate" placeholder="Your First Name" data-error-message="Please enter your name"> | |
</div> | |
<div class="form-group"> | |
<input type="text" class="form-control form-validate" placeholder="Your Last Name" data-error-message="Please enter your surname"> | |
</div> | |
... | |
... | |
<div class="form-group"> |
NewerOlder