2013-10-05 21 views
0

我需要插入由用戶鍵入的網址:

<input name="endereco" type="text" size="90" maxlength="900" /> 

在:

document.location.href = "IN_HERE"; 

有得類似:

document.location.href = "$ _POST [" address "]"; 

echo "<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=$_POST["endereco"]'>"; 

打開之前由用戶輸入的鏈接...怎麼辦?

+0

相關:http://stackoverflow.com/questions/1961069/getting-value-get-or-post-variable-using-javascript –

回答

0
<input type="text" name="endereco" id="endereco"> 
<script> 
$(document).ready(function() { 
var url=document.getElementById("endereco").value; 
document.location.href=url; 
}); 
</script> 

echo "<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=<?php echo $_POST["endereco"];?>'>"; 
+0

Thankssss \ o大 – Eddskt