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

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.