English 中文(简体)
标题 相对路径兼容性[复制]
原标题:Header Location relative path compatibility [duplicate]

这一网站relative placehtml的头盔与所有平台的所有浏览器完全一致? 任何标准?

Location: some_script.php?la=2&po=2030

我指的是,它总是会改用一些文字。 现行继承人所在地点?

最佳回答

标准是:

header( Location: http://www.mywebsite.com/yourpage.php?id=32 , TRUE, 302);

但是,为了回答你的问题,如果你没有首先或完全的URL的话,它会改用现在的圆页X。

在此,我想建议你们为你们的每一个网站做些什么。 在你的主要档案中(主文件S.C.S.R.S.C.S.M.S.M.S.M.S.M.S.M.S.M.S.M.S.M.S.M.S.M.S.M.S.S.M.S.M.S.M.S.M.M.S.M.S.M.S.M.A.S.M.M.K.,在你的主要档案中(主文件S.G.和M.S.M.S.S.)制造了类似的东西。

define( URL ,  http://www.mywebsite.com/ );

因此,当你制造方向、联系或关系时,你会这样做:

header( Location:  .URL. yourpage.php?id=32 , TRUE, 302);

EDIT:2017年11月。 如下文“jordanbtucker”所述,“吉普林特”光谱已于2014年6月更新(该员额从2012年起),允许位于定位头上的相对URIs。

问题回答

最好的办法是:

$server = $_SERVER[ SERVER_NAME ];
$port = isset($_SERVER[ HTTP_X_FORWARDED_PORT ]) && !empty($_SERVER[ HTTP_X_FORWARDED_PORT ]) ?  : . $_SERVER[ HTTP_X_FORWARDED_PORT ] :   ;
$protocol = $_SERVER[ PROTOCOL ] = isset($_SERVER[ HTTP_X_FORWARDED_PROTO ]) && !empty($_SERVER[ HTTP_X_FORWARDED_PROTO ]) ? "https://" : "http://";
$destination =  some_script.php?la=2&po=2030 ;
$url = $protocol . $server . $port . $destination;
header( Location:  . $url, TRUE);

在分配任何实际产出之前,必须召集该负责人。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签