From f94ab2ee016fc98d17911135298b93abfbd2ce8d Mon Sep 17 00:00:00 2001 From: alopexc0de Date: Sun, 22 Jun 2014 01:24:17 -0400 Subject: [PATCH] Add the link processor and begin modifications Based off of http://lob.li/b7o without API stuff Making modifications --- Website/process.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Website/process.php diff --git a/Website/process.php b/Website/process.php new file mode 100644 index 0000000..b9e0718 --- /dev/null +++ b/Website/process.php @@ -0,0 +1,42 @@ +Oh Noes! Something happened and I can't continue.
Please try again by using the form located at http://unps.us."); + } + + require('api/api.backend.php'); + require('api/dbsettings.php'); + + $key = '9a211e90b0a0570ed33e47428231e702af47b6f54fb347960f661184e063a1d0'; // KEEP THIS PRIVATE! This is the only thing that authenticates the application + + function sanitize($input){ + if ($input == null) die("
Sanatize() - No Input Provided, Aborting
"); + include('api/dbsettings.php'); + $output = strip_tags($input); + $output = stripslashes($output); + $output = $apidb->real_escape_string($output); + return $output; + } + + $unpsAPI = new api(); + + if(!empty($_POST['link']) && !empty($_POST['linkmod'])){ + switch ($_POST['linkmod']){ + case "shorten": + $short = sanitize($_POST['link']); + if(strpos($short, "http://") === false && strpos($short, "https://") === false){ + $short = "http://$short"; + } + echo $unpsAPI->shorten($apidb, $key, $shortdb, $short); + break; + default: + die("
I don't know what you want to do... [-Check linkmod-]
"); + } + }else{ die("
I can't do my job if I'm not given a link to work on...
"); } + +?> \ No newline at end of file