私は正しく動作するようには見えないこのコードを持っています。私はこれを正しく投稿したいと思います。ユーザーのテキスト入力を元のhrefリンク10分間、その期間の他の訪問者のためにクリック可能であり、元のhrefに戻る。 10分ごとに繰り返し繰り返しますすべての助けが大いに感謝されるでしょう。動的にユーザーのテキスト入力と動的リンクを変更します
<script type="text/javascript">
function changeURLOfAnchorWithID(anchor_id,new_href)
\t {
\t document.getElementById("anchor").href = new_href;
\t }
function formOnSubmit(formElm)
\t {
\t changeURLOfAnchorWithID("anchor",formElm.new_url.value+"");
\t return false;
\t }
</script>
</head>
<body>
<a id="anchor" href="https://www.whatever.com/"> <!--Keeps new url active for 10 minutes after user leaves site and other visitors are able to click there submitted link instead, then resets to default setting after 10 minutes-->
<img border="0" src="https://www.whatever.com" width="468" height="60"></a>
<form onsubmit="return formOnSubmit(this)">
<input type="text" name="new_url" value="" size="36" /><br /> <!--value added to the end of the static address in the anchor tag -->
<input type="submit" value="change href" />
</form>
OKこれは、私が作ってみたものですPHPが良いを動作し、別のページの情報を更新し、私はに入力された情報を持っていると思いますテキストボックスは、PHPページのHREFリンクの終わりを置き換え、他の誰かがそこにPHPを更新するまで最低10分間そこにとどまります。私は、リンクが10分後に元のリンクに戻る必要はないと判断しました。
HTML
<form method="post" action="phptest.php">
<textarea name="Box" cols="20" rows="1"></textarea><br>
<input type="submit" value="Submit" />
</form>
PHP
<?php echo $_POST["Box"] ?>