0

Error_log:

[Fri Jul 28 20:07:46.827740 2017] [fcgid:warn] [pid 5991] [client 79.146.9.122:48057] mod_fcgid: stderr: PHP Notice: Undefined index: close in /home/x/public_html/mt4/index.php on line 3

Access_log:

79.146.9.122 - - [28/Jul/2017:20:07:46 +0200] "POST /mt4/index.php?close=0.06949000 HTTP/1.1" 200 3 "-" "MetaTrader 4 Terminal/4.1090 (Windows NT 5.1; x64)"

Code:

<?php
$f=fopen('eth-btc.json','w');
fwrite($f,$_POST['close']);
fclose($f);
echo 200;
?>

Also tried with $_GET['close'] and $_REQUEST['close']

Ben Muircroft
  • 2,936
  • 8
  • 39
  • 66

2 Answers2

1

According to your access log it should be $_POST

  fwrite($f,$_POST['close']);
Niklesh Raut
  • 34,013
  • 16
  • 75
  • 109
1

use $_REQUEST['close'] instead of $_GET['close']

Hamid Shariati
  • 546
  • 6
  • 18