-1
我的代码的相关部分如下所示。PHP标题重定向消息发送到浏览器,但不重定向
try
{
$customer = \Stripe\Customer::create(array(
'email' => $_POST['custEmail'],
'source' => $_POST['stripeToken'],
'plan' => 'my_plan'
));
header("Location:https://something.com");
exit;
}
catch(Exception $e)
{
//header('Location:oops.html');
echo "no work";
error_log("unable to sign up customer:" . $_POST['custEmail'].
", error:" . $e->getMessage());
}
从我的PHP文件中的响应包括这样的:
HTTP/1.1 302 Found
Date: Sun, 31 Jul 2016 21:13:52 GMT
Server: Apache/2.4.23 (Amazon) OpenSSL/1.0.1k-fips PHP/5.6.22
X-Powered-By: PHP/5.6.22
Location: https://something.com
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
因此,该消息是回来(我猜的),但我的浏览器不重定向。我错过了什么?
“消息回来(我猜)”是什么意思? – 2016-07-31 21:21:39
@Dagon我的意思是基于我的PHP的响应头文件(显示问题),我的浏览器获取重定向消息,但不会对它做任何事情。 – jonmrich
这样页面不会变成'https:// something.com'? – 2016-07-31 21:24:16