douduan6731 2015-09-05 14:04 采纳率: 0%
浏览 268

php文件返回html 302错误代码

HI I have the following folder structure

/app/start.php

/php/ProcessOrder.PHP

/php/Checkout.php

Checkout.php is a test api call to paypal and when i put the full URL in the browser it works great.

my Index.html makes a post to ProcessOrder.php which saves the data to my database then should work with the api to pass the details to paypal.

both processorder and checkout are in the same folder and both have the same require statement

 require ("/../app/start.php");

why does process.php return html 302, but checkout runs? I believe it's the require statement as when I rem it out the file process ok apart from the paypal also I got the database all working before starting on the paypal API.

discovered its the last line

which should take me to paypal the url https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-1PG60856DA4942405

the line code is,

header("Location: {$approvalUrl}");

this line is the same in processorder and checkout.php

  • 写回答

1条回答 默认 最新

  • douzhang7184 2015-09-05 14:11
    关注

    As you have some weird casing in your files (mixing lower and upper case) your web server is probably configured to match for mixed case extensions and redirect the client to the correct one.

    It is best practice to do all your files in lower case extensions only, and only refer them in the exact case they are on the file system. Best way to force yourself to do this properly is configure your web server such that it simply yields a 404 when the case mismatches.

    It is a very MS-DOS'y way to do otherwise, as DOS and Windows aren't strictly case sensitive, but HTTP (as most other things in the world ;)) is.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?