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></title> | |
<link rel="stylesheet" href="css/styles.css"> | |
<!--[if lt IE 9]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
</head> |
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
<?php | |
function get_working_days($startDate,$endDate){ | |
$holidays = array( | |
'2013-03-29', | |
'2013-04-01', | |
'2013-05-06', | |
'2013-05-27', | |
'2013-08-26', | |
'2013-12-25', |
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
<?php | |
if(isset($_GET['submit'])){ | |
extract($_POST); | |
if(!empty($subject)){ $extra.= " AND subject = '$subject'"; } | |
if(!empty($id)){ $extra.= " AND id = '$id'"; } | |
if(!empty($FirstName)){ $extra.= " AND FirstName = '$FirstName'"; } | |
if(!empty($LastName)){ $extra.= " AND LastName = '$LastName'"; } | |
if(!empty($address)){ $extra.= " AND address = '$address'"; } |
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
<?php | |
$text = 'word1 some more words. word2 and some more words'; | |
$text = preg_replace_callback('!\w+!', 'filter_bad_words', $text); | |
echo $text; | |
function filter_bad_words($matches) { | |
$bad_words = array( | |
'word1' => 'gosh', | |
'word2' => 'darn', |
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
<?php | |
date_default_timezone_set('Europe/London'); | |
$m= date("m"); | |
$de= date("d"); | |
$y= date("Y"); | |
?> | |
<select name'dates'> | |
<?php |
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
<?php | |
function cleanData($str){ | |
$str = preg_replace("/\t/", "\\t", $str); | |
$str = preg_replace("/\n/", "\\n", $str); | |
} | |
$filename = "export_" . date('Y-m-d-h-i-s') . ".xls"; | |
header("Content-Disposition: attachment; filename=\"$filename\""); |
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
<?php | |
//connection details | |
$host = 'localhost'; | |
$dbname = 'database name'; | |
$dbusername = 'database username'; | |
$password = 'db password'; | |
//make a connection | |
$db = new PDO("mysql:$host=;port=8889;$dbname=", $dbusername, $password); | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
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
<?php | |
$address = "UK+Hull"; | |
$url = "http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false®ion=England"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_PROXYPORT, 3128); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
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
<?php | |
session_start(); | |
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); | |
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); | |
header("Cache-Control: no-store, no-cache, must-revalidate"); | |
header("Cache-Control: post-check=0, pre-check=0", false); | |
header("Pragma: no-cache"); | |
function _generateRandom($length=6) | |
{ |
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
<?php | |
//Blackpool North, Bispham, Cleveleys | |
$parts = explode(",",$_POST['area']); | |
echo '<pre>'; | |
print_r($parts); | |
echo '</pre>'; | |
//output: |
OlderNewer