Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/427.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将HTTPS上的HTTP引用设置为HTTPS站点_Php_Javascript_Html_.net - Fatal编程技术网

Php 将HTTPS上的HTTP引用设置为HTTPS站点

Php 将HTTPS上的HTTP引用设置为HTTPS站点,php,javascript,html,.net,Php,Javascript,Html,.net,有人能告诉我如何避免http引用url吗。我有一个html表单,我想使用Javascript发布表单。是否可以将推荐人url设置为空。 这是代码,请让我知道这是可能的,或者你有任何选择 谢谢你的帮助 <!DOCTYPE html> <html> <body> <script type="text/javascript"> document.write('<form id="l" method="post" action="https://w

有人能告诉我如何避免http引用url吗。我有一个html表单,我想使用Javascript发布表单。是否可以将推荐人url设置为空。 这是代码,请让我知道这是可能的,或者你有任何选择 谢谢你的帮助

<!DOCTYPE html>
<html>
<body>

<script type="text/javascript">
document.write('<form id="l" method="post" action="https://www.test.com">');
document.write('<input type="hidden" id="e" name="email">');
document.write('<input type="hidden" name="pass" id="p"></form>');

function g(x){

  return document.getElementById(x);
}

g('e').value='username';
g('p').value="password";
g('l').submit();
</script>

</body>
</html>

文件。写(“”);
文件。写(“”);
文件。写(“”);
函数g(x){
返回文档.getElementById(x);
}
g('e')。value='username';
g('p')。value=“密码”;
g('l')。提交();

浏览器发送给服务器的是
Referer
标题。您不能更改它,因为浏览器不提供javascript api来更改它


浏览器发送窗口对象的location.href。如果您将其更改为其他位置,如location.href=“”,浏览器将从您的页面导航到

有一个引用URL有什么不好?我确实理解它的有用和重要,但我需要意识到这一点,所以我想知道我是否可以处理浏览器集标题,这听起来确实合法;)要标记为回答是不可能的,我将标记为回答。您能告诉我它发送推荐人url的依据吗。如果它的https到https重定向,它会不会设置那个?