CSI: PHP

"Looking at your tweets I cannot even fathom what your job is. CSI:PHP?" — @grmpyprogrammer

Typical

| Comments

There’s nothing wrong with testing your application with dirty, ugly scripts like this. There is something wrong with dropping the test in the /includes folder, never deleting it, deploying it to production, and naming it editissues.php in an application where issue editing occurs.

1
2
3
4
5
6
7
8
9
10
11
12
<?php

$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$app = 'training_inc';
$to = "redacted@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?\n\n$_SERVER[REMOTE_ADDR]\n$hostname\n app=$app";
if (mail($to, $subject, $body)) {
    echo("<p>Message successfully sent!</p>");
} else {
    echo("<p>Message delivery failed...</p>");
}

Comments