Hack Forums
[PHP] API Key and CMD Script | Could be used for Skype Resolver API - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] API Key and CMD Script | Could be used for Skype Resolver API (/showthread.php?tid=4536574)



API Key and CMD Script | Could be used for Skype Resolver API - Flacko. - Nov 13, 2014

Main purpose: If you know how an API Key works, this should be very simple for you. This could also be used for a Skype Resolver API, or other things you want to add into it.

Say, you wanted to show CMD2; input would be http://domain.com/test.php?key=key1&cmd=1

This could be useful to some, others.. Not so much.

Code
<?php
/*
Coded by White Spy from HF.
Profile: hackforums.net/member.php?action=profile&uid=2236072
*/
?>

<?php
//Gets the ?key from domain link.
$key = $_GET['key'];

//Gets the &cmd= from domain link.
$cmd = $_GET['cmd'];
?>

<?php
//Checks to see if the key is blank.
if($key == null)
{
echo '<font color="red">ERROR</font>: Enter your key.</font>';
} else {

//Checks to see if the cmd is blank.
if($cmd == null)
{
echo '<font color="red">ERROR</font>: Enter a command.</font>';
} else {

//Clears site.
ob_end_clean();

//If Key entered correctly, it will show form.
//You can also edit the key to whatever you like.
if($key == "key1" || $key == "key2")
{

//Echo's what command you selected.
echo '<font size="3">('.$cmd.')</font>';

//If you are wanting to get information from a site, uncheck the '//' and enter in your link between the ''.
//$link1 = file_get_contents('http://your domain.com/document.txt');
//$link2 = file_get_contents('http://your domain.com/document.txt');
//$link3 = file_get_contents('http://your domain.com/document.txt');
{
if($cmd == "4")
{
echo "Command is not available at this time.";
} else {

//Checks if CMD=1
if($cmd == '1')
{
echo "Command 1 selected.";
//echo $link1; //uncheck lines if you are using this to get information from site.
} else {

//Checks if CMD=2
if($cmd == '2')
{
echo "Command 2 selected.";
//echo $link2; //uncheck lines if you are using this to get information from site.
} else {

//Checks if CMD=3
if($cmd == '3')
{
echo "Command 3 selected.";
//echo $link3; //uncheck lines if you are using this to get information from site.
} else {
echo " Unknown Command.";
}
}
}
}
}
}
}
}
?>