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($_POST['Submit'])){ //this nifty if statement checks to see if there is a submit in the post. | |
send_mail("[email protected]", $_POST['subject'], $_POST['message'], $_POST['header']); //if a submit is found, the email is sent | |
} | |
else { //is not, the form is displayed | |
show_form(); | |
} | |
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 | |
//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 { |
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 | |
class Log{ | |
var $page_location; | |
var $log_msg; | |
function set_page($page_location){ | |
$this->page_location = $page_location; | |
} |
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 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) { |
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
1.upto(61) { | |
|i| File.open("test" + i.to_s() + ".csv", 'w') {|file| | |
file.puts "The line that you want to write" | |
} | |
} |
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
File.open("email_lists", 'w') {|file| | |
101.upto(161) { |i| | |
file.puts "client" + i.to_s + "@domain.com" | |
}} |
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 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; |
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 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); |
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
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; |
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 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 "> |
OlderNewer