secret
Created

My Little Pony: Friendship is Magic as code

  • Download Gist
mlp_fim_code.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<?php
$friendship=$magic;
 
function learned($start,$end){
$msg='';
$lesson=mysql_query("SELECT story, friendsid, about, date, plot FROM friendship INNER JOIN ponies ON ponies.id = friendship.friendsid WHERE friendship.about IS NOT NULL AND date>'$start' AND date<'$end' LIMIT 1");
while ($episode = mysql_fetch_assoc($lesson)){
$msg.=$episode['plot']."rn";
}
return $msg;
}
 
$greeting = "Dear Princess Celestia,rnrn";
$signature="rnrnYour Faithful Student,rnTwilight Sparkle";
 
$to = 'celestia@equestria.gov';
$subject = 'Daily report: '.date("m.d.y");
$headers = 'From: twi@ponyvile.edu' . "rn" .
'Reply-To: spike@twilightslibrary.com' . "rn" .
'X-Mailer: PHP/' . phpversion();
 
$message=$greeting.learned(time()-86400,time()).$signature;
 
mail($to, $subject, $message, $headers);
?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.