全网最简易的防红代码


全网最简易的防红代码 话不多直接代码

 

<?php

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

$longUrl = $_POST['longurl'];

$apiUrl = 'http://shenlian.t.npcq.cn/?fh=generate&mode=freeapi&longurl=' . urlencode($longUrl);

$response = file_get_contents($apiUrl);

$responseData = json_decode($response, true);

if ($responseData && isset($responseData['ae_url'])) {

$shortUrl = $responseData['ae_url'];

echo $shortUrl;

} else {

echo '神链牛逼';

}

}

?>

<html>

<head>

<title>生成短链接</title>

</head>

<body>

<center> <form method="POST" action="">

<label for="longurl">长链接:</label>

<input type="text" name="longurl" id="longurl" required><br>

<input type="submit" value="生成短链接"><br>

</form></center>

</body>

<html>

给TA打赏
共{{data.count}}人
人已打赏
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索