- Katılım
- 20 Eki 2021
- Mesajlar
- 16
- Tepkime puanı
- 0
- Puanları
- 53
Herkese merhaba, kendime ait olan bu api sayesinde web sitelerinizde port kontrolü yapabilirsiniz.
PHP:
<form action="" method="POST">
<input type="text" name="ipaddress" id="ipaddress" placeholder="IP Adresi" value="<?=@$_POST['ipaddress'];?>" required="" /><br />
<input type="number" name="port" id="port" placeholder="Port" value="<?=@$_POST['port'];?>" required="" /><br /><br />
<li><input type="submit" name="submit" class="button" value="Kontrol Et"></input></li>
</form>
<?php
if(isset($_POST['submit'])) {
$data = [
'ipaddress' => $_POST['ipaddress'],
'port' => $_POST['port']
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.avokadogames.com/portcontrol/portcontrol.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if($result['message'] == "ACTIVE"){
echo '<font color="green">'.@$_POST["ipaddress"].' port-'.@$_POST["port"].' açık</font>';
}elseif($result['message'] == "DEACTIVE"){
echo '<font color="red">'.@$_POST["ipaddress"].' port-'.@$_POST["port"].' kapalı</font>';
}
}
?>