<h1 align='center'>Hello, World! 该项目页面由ChatGpt 提供技术支持</h1>
<p align='center'>当前XshellGithubAnonymousRat远程协助工具实时在线:<?php
$url = 'https://www.xladmin.com/shujurenshu/onlineip.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
curl_close($ch);
<p>preg_match_all('/&lt;body.<em>?&gt;(.</em>?)</body>/si', $output, $matches);</p>
<p>echo $matches[1][0];
?&gt;人在线</p></p>
<!-- 添加搜索框 -->
<form method='get'>
  <label for='search'>搜索项目:</label>
  <input type='text' name='search' id='search' value='<?php echo isset($_GET['search']) ? htmlspecialchars($_GET['search']) : ''; ?>'>
  <button type='submit'>搜索</button>
</form>
<?php
// 读取JSON文件
$data = file_get_contents('projects.json');
$projects = json_decode($data, true);

// 处理搜索请求
if(isset($_GET['search'])) {
  $search = htmlspecialchars($_GET['search']);
  $filteredProjects = array_filter($projects['projects'], function($project) use ($search) {
    return strpos(strtolower($project['name']), strtolower($search)) !== false;
  });
  $projects['projects'] = array_values($filteredProjects);
}

// 显示每个项目的信息
echo '<div class='container'>';
foreach($projects['projects'] as $project) {
  echo '<div class='project'>';
  echo '<img src=' . $project['image'] . '>';
  echo '<h2>' . $project['name'] . '</h2>';
  echo '<p>' . $project['description'] . '</p>';
  echo '<a href=' . $project['link'] . '>项目进入</a>';
  echo '</div>';
}
echo '</div>';

// 显示搜索框
echo '<form method='get'>';
echo '<input type='text' name='search' placeholder='搜索项目'>';
echo '<button type='submit'>搜索</button>';
echo '</form>';

?>
<style>
form {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

input[type='text'] {
  padding: 10px;
  border: none;
  border-radius: 20px;
  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 16px;
  width: 300px;
  margin-right: 10px;
}

button[type='submit'] {
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
}
  .container{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 20px;
    padding: 20px;
  }

  .project {
    border: 1px solid #ccc;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
  }
  
  .project img {
    max-width: 100%;
    margin-bottom: 10px;
  }
  
  .project h2 {
    font-size: 24px;
    margin-bottom: 10px;
  }
  
  .project p {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .project a {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 10px;
  }
  
  .project a:hover {
    background-color: #0062cc;
  }
</style>
<title>XLAdmin-项目化主页-由ChatGpt生成</title>
<style>
footer {
  text-align: center;
  background-color: #f2f2f2;
  padding: 10px;
}
</style>
<footer>
<?php
    if(!file_exists('count.txt')){
        $one_file=fopen('count.txt','w+'); //建立一个统计文本,如果不存在就创建
        echo'您是第<font color='red'><b>10007</b></font>位访客'; //首次直接输出第一次
        fwrite('count.txt','1');  //把数字1写入文本
        fclose('$one_file');
     }else{ //如果不是第一次访问直接读取内容,并+1,写入更新后再显示新的访客数
        $num=file_get_contents('count.txt');
        $num++;
        file_put_contents('count.txt','$num');
        $newnum=file_get_contents('count.txt');
        echo'您是第<font color='red'><b>'.$newnum.'</b></font>位访客';
    }
?>
  <p>© 2023 GhostKylin</p>
</footer>
背景模糊,首次访问弹出设置黑夜或者白天询问框,并保存cookie,内容:暂时不支持该功能。
XLAdmin - 项目化主页 - 由ChatGpt 生成

原文地址: https://www.cveoy.top/t/topic/mCZt 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录