小编Guu*_*ijn的帖子

如何保护PHP脚本?

我有一个PHP脚本.在这个脚本中,我将连接到FTP服务器,并显示一个文件.什么是保护此脚本的最佳方法,因此只能在1小时内登录5次或类似的东西?

我的剧本:

<?php
session_start();

$_SESSION["ftp_user"] = $_POST["user"];    
$_SESSION["ftp_pass"] = $_POST["pass"];
$ftp_pass = $_POST["pass"];
$ftp_server = "ftp.guusvanwalstijn.nl";

function test()    
{ 
echo "Do whatever i want";
}


// Verbinding maken
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); 


// Error die je krijgt als je het wachtwoord verkeerd hebt ingetypt
function error_while_connecting() {
echo "Error while connecting to the server";
echo "<br />Probably the password is wrong or the server is offline";
}

// Inloggen met de gegeven inloggegevens
if (@ftp_login($conn_id, $ftp_user, …
Run Code Online (Sandbox Code Playgroud)

php security ftp

4
推荐指数
1
解决办法
146
查看次数

标签 统计

ftp ×1

php ×1

security ×1