download2014711 2016-07-28 16:33
浏览 26

包括来自url的php文件与php [关闭]

**i need use this file php Variables post server on url **

http://example.com/addData.php   (the other server)
-------------------------------------
$a_player1 = $_POST['a_player1'] = 1;            
$a_player2 = $_POST['a_player2'] = 3;

 htto://srore.com/getdata.php
 -------------------------------------
include("http://example.com/addData.php");
echo $a_player1;
echo $a_player2;

error ???

Notice: Undefined variable: a_player1
Notice: Undefined variable: a_player2

php.ini settings then allow_url_include On

  • 写回答

2条回答 默认 最新

  • duanjiao2978 2016-07-28 16:38
    关注

    You're including via an absolute URL (which is a hideously bad security problem), which means you're EXECUTING that "remote" php script, and loading its OUTPUT, not the php code it contains.

    And if allow_url_fopen is disabled, then nothing gets loaded anyways, and no php code will be seen, because that url is never hit.

    If that file is on the same server/site as your main one, then do NOT use a url, a simple include('addData.php') will do.

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么