douba1498 2019-02-19 21:04
浏览 93

如何确定php curl的日期格式?

I have a simple script that curls into a site to get flight information. The site has input for departure city, arrival city, and date. The date field on the actual site uses datepicker with a placeholder format as mm/dd/yyyy, and when a date is selected with date picker the date input field populates with something like 04/14/2019.

My script includes:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.somesite.com");

$curl_data = "dep=YYY&arr=ZZZ&date=04/14/2019";

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$output = curl_exec($ch);
curl_close($ch);

When I echo the output, it always tell me that I submitted an invalid date. I've tried multiple formats. Any ideas on how to determine the proper date format or what else I might need to do?

Thanks.

  • 写回答

1条回答 默认 最新

  • dounue1965 2019-02-19 21:10
    关注

    When you submit the form on the real site you can check the POST data with the web developers console: How can I debug a HTTP POST in Chrome?

    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计