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 | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
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 Uploader{ | |
public $file; | |
private $mimetypes = array('application/x-bittorrent', 'application/x-nzb'); //mimetypes in an array | |
private $extensions = array('.torrent', '.nzb'); //file extensions | |
public function __construct($file, $type){ //the constructor for setup some vars | |
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 | |
/* | |
Plugin Name: Editors Add Users | |
Description: Allow editors to add user roles | |
Author: Christopher Davis | |
Author URI: http://www.christopherguitar.me | |
License: GPL2 | |
*/ | |
register_activation_hook( __FILE__, 'wpse42003_activation' ); |
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
<html> | |
<head> | |
<title>Simple Line Graph using SVG and d3.js</title> | |
<script src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<style> | |
/* tell the SVG path to be a thin blue line without any area fill */ | |
path { | |
stroke: steelblue; | |
stroke-width: 1; | |
fill: none; |
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
<? | |
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted | |
$title = $_POST['thread_title']; //set our title | |
if ($_POST['thread_description']=="") { // check if a description was entered | |
$description = "See thread title..."; // if not, use placeholder | |
} else { | |
$description = $_POST['thread_description']; //if so, use it |
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 themename_customize_register($wp_customize){ | |
$wp_customize->add_section('themename_color_scheme', array( | |
'title' => __('Color Scheme', 'themename'), | |
'priority' => 120, | |
)); | |
// ============================= |
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 | |
/** | |
* @author James Morris <[email protected]> | |
*/ | |
$html = <<<'EOF' | |
<html> | |
<body> | |
<h1>Foo</h1> | |
<div id="content"> |
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 | |
/* | |
-- the SQL database table | |
create table form_ajax ( | |
ID varchar(5) not null, | |
Name varchar(100), | |
Address varchar(100), | |
Phone varchar(20), | |
Email varchar(255), |
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 | |
// See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html | |
// Start a session (which should use cookies over HTTP only). | |
session_start(); | |
// Create a new CSRF token. | |
if (! isset($_SESSION['csrf_token'])) { | |
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32)); | |
} |
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
<form action="" enctype="multipart/form-data" method="post"> | |
<input id="file" name="file" type="file" /> | |
<input id="Submit" name="submit" type="submit" value="Submit" /> | |
</form> |
OlderNewer