在 post 方法中隐藏表单操作 url

2024-02-10


我下面有这段代码,我想将其插入新脚本中

<?php
session_start();

$host = "localhost";
$username = "#";
$password = "#";	
$dbname = "#";

$ip = getenv("REMOTE_ADDR") ;
$time = time();
$waktu = date("G:i:s",time());
//database connect
mysql_connect($host,$username,$password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
mysql_query("SET NAMES utf8");

 mysql_query("CREATE TABLE IF NOT EXISTS `cookies` (
`ip` varchar(32) NOT NULL DEFAULT '',
`time` varchar(32) DEFAULT NULL,
`waktu` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ip`)
ENGINE=MyISAM DEFAULT CHARSET=utf8;
) 
");

function get_html($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	curl_setopt($ch, CURLOPT_FAILONERROR, 0);
    $data = curl_exec($ch);
    curl_close($ch);
	return $data;
    }
$token = $_SESSION['token'];

if($token){
	$graph_url ="http://example.com?user=" . $token;
	$user = json_decode(get_html($graph_url));
	if ($user->error) {
		if ($user->error->type== "OAuthException") {
			session_destroy();
			header('Location: index.php?info=403');
			}
		}
	}
	else{
	header('Location: index.php');
	}
	$result = mysql_query("
      SELECT * FROM cookie WHERE ip = '$ip'");
	if($result){
     while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
			$times = $row;
			}
	$timer = time()- $times['time'];
	$countdown = 900 - $timer;
	};	
if(isset($_POST['submit'])) {
        $token = $_SESSION['token'];
           if(!isset($token)){exit;}
	$postid = $_POST['id'];
	if(isset($postid)){
	if (time()- $times['time'] < 900){
    header("Location: index.php?info=404");
	}
	else{
	
	mysql_query("REPLACE INTO cookie (ip,time,waktu) VALUES ( '$ip','$time','$waktu')");
	$ch = curl_init('http://example.com/secure.php'); 
	curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_POST, 1);
	curl_setopt ($ch, CURLOPT_POSTFIELDS, "id=$postid");
	$hasil = curl_exec ($ch);
	curl_close ($ch);
    if (strpos($hasil,'GAGAL') !== false) {
		echo 'Done';
			}else{
        //header("Location: index.php");
        header("Location: index.php?info=401");
	}
	}
	}else{
	header("Location: index.php");
	};
}else{
$go ="hello";
}

	
	$urlSplitted = explode('?fbid=', $_GET['url']); 
	$fbid = $urlSplitted[1];
	
?>

接下来我有新的脚本仪表板,其代码如下:

<?php
session_start();
if(!isset($_SESSION["sess_user"])){
	header("location:index.php");
}

	$fbid = '7676767676';

?>

<form action="" method="post" class="form-wrapper cf">
 Id Is: <font color="red"><strong><?php echo $fbid; ?></strong></font>
<input name="id" value="<?php echo $fbid; ?>" type="hidden">
<input type="submit" value="send">
</form>

现在我想使用 secure.php 作为隐藏,这样没有人可以在表单操作中看到该文件,当我发送表单时,它会自动将数据发送到 secure.php
我不需要任何数据库来保存数据,也不需要 900 秒计时器,我无法尽可能简单地编辑它。
任何帮助将不胜感激!谢谢。


PHP 代码对你的问题毫无用处。

要混淆操作 url,您可以使用一些 javascript 仅在提交时设置属性。在这里你可以看到一个愚蠢的例子:http://codepen.io/anon/pen/gprygB http://codepen.io/anon/pen/gprygB

$("form").submit(function() {
  $(this).attr("action", "realAction");
});

因此,您还可以使用一些 crypt/uglify 库来隐藏 js 文件中的 realAction。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 post 方法中隐藏表单操作 url 的相关文章

  • 在 MongoDB 中对 Null 值进行最后排序

    我使用以下查询根据名为 sortIndex 的字段按升序填充 MongoDB 中的项目 有时 数据库中的项目没有 sortIndex 字段 通过以下查询 具有 null sortIndex 的项目显示在顶部 我想知道如何让它们显示在底部 我
  • Preg_split 用逗号,忽略括号,PHP

    我必须分割一个字符串 并且我想避免用括号内的逗号分割它 那么我该如何实现呢 Example string string1 sString1 sString2 ssString1 ssString2 string2 string3 resul
  • 如何以编程方式确定 HTML 对象可以侦听哪些事件?

    我一直在查看developer mozilla org 和Apple 开发文档上的文档 但我找不到解释是否可以通过编程方式确定特定HTML 标记是否支持给定事件监听器的文档 就像我知道的那样
  • 量角器检查元素是否不存在

    我在基于角度的网站中有一个设置可以打开和关闭下拉菜单 如果关闭 则不会显示在主页上 对于量角器 我需要检查开关关闭时该元素是否不存在 但是 我不应该陷入 未找到元素 错误 因为它是一组许多测试中的一个 我该怎么做 我曾尝试这样做 expec
  • 容器中的等间距 div

    这是我的例子 http jsfiddle net rtCP3 62 http jsfiddle net rtCP3 62 我有 3 个 或更多 div 我想在一个容器中均匀分布 当将 Angular 与 ng repeat 一起使用时 样式
  • Php mod_rewrite 无法正常工作

    我有一个带有以下链接结构的 php 页面 http localhost wisper businesspage php profile creativeartbd 所以我尝试将此链接转换为以下样式 http localhost wisper
  • 在 X 轴刻度上渲染 HTML

    我想在 D3 图表的 x 轴上渲染 HTML 基本上 我希望轴上的每个标签都是到数据中另一列的超链接 我试过了 x domain data map function d return a href d Name a 但它根本不起作用 我得到
  • 如果是数字,Chrome 会重新排序对象键,这是正常/预期的吗

    我注意到某些评估电子商务网站的某些鞋码并将其输出到屏幕上的代码会打乱 Chrome 中的顺序 给出的 JSON 可以是 7 9149 9139 10455 17208 7 5 9140 9150 10456 17209 8 2684 914
  • Vim、Javascript、DoctorJS (jsctags) 和 Taglist(源代码浏览)

    我已经安装了DoctorJS http doctorjs org 之前jsctags 试图为 Vim 获得一些好的源代码浏览 标签列表 使用Taglist http www vim org scripts script php script
  • Javascript TypeError:无法读取未定义的属性“indexOf”

    在此代码中 我想从cart products array var cart products 17 1 19 1 18 1 var product 17 each cart products function key item if ite
  • 在 GeoJson 数据接收到的 Google 地图多边形上放置标签

    我想将带有信息的标签 或带有标签的 div 放在由下面的代码片段绘制的多边形上 样式属性已成功应用于要素 多边形类型 有谁知道如何向该特征添加文本并将其显示在多边形的中心 function handleGeoJson data map da
  • PHP字符串比较和相似度索引

    在 PHP 中 有什么优雅的代码可以在两个字符串中查找公共字母而不包含空格 还返回相似性索引 即计算常见字符的数量并返回占字符总数的百分比 假设我有一个字符串 LEGENDARY 而其他字符串为 BARNEY STINSON 所以我需要找到
  • Selenium 查看鼠标/指针

    有什么方法可以在运行测试时真正看到硒鼠标吗 要么是 Windows 光标图像 要么是某种点或十字线或任何东西 我正在尝试使用拖放功能selenium and java in an HTML5Web 应用程序 并且能够看到光标以了解它实际在做
  • 需要在 javascript 中对 ajax 查询进行正确的修剪吗?

    在 JavaScript 中 我想对字符串末尾的所有特殊字符进行正确的修剪 我的一段代码仅对连字符 进行修剪 还需要所有特殊字符 var s DB var x s replace console log x 对此有什么帮助吗 这应该可以解决
  • 页脚没有停留在底部

    这似乎是有史以来最令人困惑的问题 至少对我来说是这样 知道这个页面 除了标题之外 都已损坏 我复制了 HTML 并尝试小心地删除 WordPress 相关的爵士乐 以便您获得该页面的 html JsBin直播页面 http jsbin co
  • 如何使用 symfony 对管理面板中自己的列进行排序?

    M schema yml News columns title type string 50 category id type integer 4 relations Category local category id foreign c
  • 检测 JavaScript 代码中的拼写错误

    在Python世界中 使用最广泛的静态代码分析工具之一 pylint has a 特别检查 https stackoverflow com questions 27162315 automated docstring and comment
  • ng-show 令人不安的 div 布局 - angularJS

    我在用ng show notesOpened 如果notesOpened 变量为true 则隐藏div 然而 当隐藏时 它会扰乱布局 有没有办法让 ng show 的行为与 css 属性相同visibility hidden 以便被隐藏的
  • Codeigniter,为MySQL创建表和用户

    我想以编程方式使用 CI 创建数据库和用户 到目前为止 我有这 2 个简单的 MySQL 语句 CREATE DATABASE testdb DEFAULT CHARACTER SET utf8 COLLATE utf8 general c
  • 是否可以使用 fs.createWriteStream 在文件中间写入文本? (或者一般在 Node.js 中)

    我正在尝试写入文本文件 但不是像appendFile 那样在最后写入或通过替换整个内容 我看到可以选择从 fs createwritestream 的启动参数开始的位置 gt https nodejs org api fs html fs

随机推荐