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
1.upto(61) {
|i| File.open("test" + i.to_s() + ".csv", 'w') {|file|
file.puts "The line that you want to write"
}
}
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) {
<?php
class Log{
var $page_location;
var $log_msg;
function set_page($page_location){
$this->page_location = $page_location;
}
<?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
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();
}