Skip to content

Instantly share code, notes, and snippets.

View weatheredwatcher's full-sized avatar
:octocat:
Working from home

David Duggins weatheredwatcher

:octocat:
Working from home
View GitHub Profile
<?php
if (isset($_POST['Submit'])){ //this nifty if statement checks to see if there is a submit in the post.
send_mail("youremail@gmail.com", $_POST['subject'], $_POST['message'], $_POST['header']); //if a submit is found, the email is sent
}
else { //is not, the form is displayed
show_form();
}
<?php
//this moves the uploaded files to the correct place
include_once ('includes/csv_reader.php');
include 'includes/dbconnect.php';
$uploads = $_SERVER{'DOCUMENT_ROOT'} . "/site/uploads/";
$approved = $uploads . 'ApprovedBilling.csv';
if(!isset($_FILES['approved'])){} else {
<?php
class Log{
var $page_location;
var $log_msg;
function set_page($page_location){
$this->page_location = $page_location;
}
function myErrorHandler($errno, $errstr, $errfile, $errline)
/**
*
* This is a collection of custom error handling procedures for the Leveraged Media System
* It is loaded in the main index file and overrides all error handling with the exception of fatal memory errors
*/
{
$myLog = new Log;
$myLog->set_page($_SERVER['PHP_SELF']);
switch ($errno) {
1.upto(61) {
|i| File.open("test" + i.to_s() + ".csv", 'w') {|file|
file.puts "The line that you want to write"
}
}
File.open("email_lists", 'w') {|file|
101.upto(161) { |i|
file.puts "client" + i.to_s + "@domain.com"
}}
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
switch ($errno) {
case E_USER_ERROR:
//here is what you display (or do) for a user error
exit(1);
break;
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
$myLog = new Log;
$myLog->set_page($_SERVER['PHP_SELF']);
switch ($errno) {
case E_USER_ERROR:
$myLog->set_log("ERROR:[$errno] Fatal error on line $errline ");
$myLog->write_log();
exit(1);
n = prompt("Enter a number greater than 1: ");
var counter = 0
function collatz(n, counter) {
document.display.myCounter.value=counter;
if (n>1) {
if (n%2) {
t = 3 * n + 1;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd" >
<html lang = "en" >
<head>
<meta http - equiv = "Content-Type"content = "text/html; charset=utf-8" >
<title > Collatz Conjecture </title>
<meta name="generator" content="TextMate http:/ / macromates.com / ">
<meta name="author " content="weatheredwatcher ">