This file contains hidden or 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"> | |
<title>HTML5 Template</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
</body> |
This file contains hidden or 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
// Add in the top level domains that you want to include, in the REGEX statement | |
function is_email($email) { | |
if(preg_match ( '/[a-zA-Z1-9\.]+\@[a-zA-Z1-9\.]+\.[com|co.za|org|co.uk|co|biz|co.au]+$/' , $email) ){ | |
$result = true; | |
} else { | |
$result = false; | |
} | |
return $result; | |
} |
This file contains hidden or 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
function connect($root, $pass) { | |
try { | |
$conn = new PDO('mysql:host=localhost; dbname=practice',$root, $pass); | |
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
return $conn; | |
} catch(Exception $e) { | |
return false; | |
} | |
} |