dongyingtang3803 2011-11-27 04:36
浏览 17

PHP在本地文件上模拟POST数据

I know cURL is primarily for fetching data from remote sites. Should you use cURL to get data from local urls that use POST data?

For example, i have a page the displays a receipt. i use this to send html emails and also for the customer to view the receipt in their browser if their email client isn't displaying it correctly.

If POST cardholder data is present it will display the first name, last name, address, city, state, zip, phone, email, and method of payment in the receipt.

I use the file_get_contents() function to retrieve that web page and send the email. The problem: No POST data is present when doing that so if you're the one getting the receipt email, your billing information won't be on it. There's no way to prove that the receipt is actually yours.

I'm trying to comply with PCI standards so i'm trying to avoid storing cardholder data in sessions or a database table.

  • 写回答

1条回答 默认 最新

  • duandun3178 2011-11-27 04:58
    关注

    Instead of using file_get_contents() could you not just use include or require in the script where you're pulling in that file? Then prior to that you could manually set the $_POST vars and the included file would fire the email and include the user data.

    //Script where you're calling file_get_contents()
    
    $_POST['firstName'] = $firstName;
    $_POST['lastName'] = $lastName;
    //etc for all fields
    
    include "your_email_script";
    
    评论

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示