insert-coin/public_html/conjure.php

71 lines
1.6 KiB
PHP
Raw Normal View History

2018-04-06 23:05:59 -05:00
<?php
$page_title = "The Conjuring";
2018-04-06 23:05:59 -05:00
include("../resources/config.php");
include("../resources/library/main.php");
2018-04-06 23:05:59 -05:00
include("../resources/templates/header.php");
echo("\n<main>\n");
2018-04-06 23:05:59 -05:00
if (!empty($_POST["url_target"]) && !empty($_POST["url_alias"]))
{
$url_target = $_POST["url_target"];
$url_alias = $_POST["url_alias"];
$url_alias = sanitize_filename($url_alias);
$visible_dest = $url_aliasize_dir . $url_alias . $url_aliasize_visible_suffix;
$dest_file = $url_aliasize_dir . $url_alias . $url_aliasize_suffix;
$beaming_permitted = 0;
2018-04-06 23:05:59 -05:00
}
else
{
$beaming_permitted = 1;
2018-04-06 23:05:59 -05:00
}
if (!filter_var($url_target, FILTER_VALIDATE_URL))
2018-04-06 23:05:59 -05:00
{
$beaming_permitted = 3;
2018-04-06 23:05:59 -05:00
}
else if (file_exists($dest_file))
2018-04-06 23:05:59 -05:00
{
$beaming_permitted = 2;
2018-04-06 23:05:59 -05:00
}
switch ($beaming_permitted)
{
case 1:
celebrate_death($dest_file, $url_aliasize_item,
$url_aliasize_die_img, $url_aliasize_die_alt,
"<p>... you didn't pick a URL/target.</p>
<p>Do it next time >;c</p>");
break;
case 2:
celebrate_death($dest_file, $url_aliasize_item,
$url_aliasize_die_img, $url_aliasize_die_alt,
"<p>Oh, sorry. Some-one just took that mask before you got here!</p>
<p>Try a different target name, doggo</p>");
break;
case 3:
celebrate_death($dest_file, $url_aliasize_item,
$url_aliasize_die_img, $url_aliasize_die_alt,
"<p>Are you screwing with me? That's not a URL</p>
<p>Nice try, buck-o</p>");
break;
case 0:
write_alias($dest_file, $url_target);
celebrate($visible_dest, $url_aliasize_item,
$url_aliasize_win_img, $url_aliasize_win_alt);
break;
2018-04-06 23:05:59 -05:00
}
?>
</main>
<?php
include("../resources/templates/footer.html");
2018-04-06 23:05:59 -05:00
?>