提交后继续浏览某些页面

时间:2016-04-03 07:29:14

标签: php

我有一个页面用于更新其调用的user_points表 pointsxxl50updateforposts.php 自动更新他们拥有用户点和 我喜欢它提交评论提交50分后,这可能是因为我尝试提交,但什么都不做 这就是我喜欢做的事情

<td><input type="submit"  name="submit" id="submit" value="Submit Post" onclick="window.location.href='http://bitcoinrotator.publiadds.org.pt/login-registration/pointsxxl50updateforposts.php'">
  </td>

这就是我在该页面上使用recaptcha选项的代码 我喜欢留在recaptcha并在提交后继续浏览该页面

http://bitcoinrotator.publiadds.org.pt/login-registration/pointsxxl50updateforposts.php

<?php
include("db.php");
 
$select=mysql_query("select * from commenttable");
while($row=mysql_fetch_array($select))
{
	echo "<div id='sty'>";
	echo "<img src='files/fav icon.png'"."' width='50px' height='50px' align='left' />";
	echo "<div id='nameid'>".$row['name']."</div>";
	echo "<div id='msgid'>".$row['message']."</div>";
	echo "</div><br />";
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Comment system using php and mysql</title>
<center><br><br><form>
<input type="button" value="Back" onclick="window.location.href='http://bitcoinrotator.publiadds.org.pt/login-registration/home.php'" />
</form></center>


<script type="text/javascript">
function validation()
{
	var nam=document.comment.namename.value;
	var nam1=document.getElementById('tnameid');
	if(nam=="")
	{
		document.comment.namename.focus();
		nam1.style.borderColor="#f00";
		return false;
	}
	var nam1=document.getElementById('tnameid');
	nam1.style.borderColor="";
	var jo=document.comment.job.value;
	var jo1=document.getElementById('tjobid');
	if(jo=="")
	{
		document.comment.job.focus();
		jo1.style.borderColor="#f00";
		return false;
	}
	var jo1=document.getElementById('tjobid');
	jo1.style.borderColor="";
	var mess=document.comment.message.value;
	var mess1=document.getElementById('tmessageid');
	if(mess=="")
	{
		document.comment.message.focus();
		mess1.style.borderColor="#f00";
		return false;
	}
}
</script>
</head>

<body>
<body bgcolor="#ffffff">
<center><form name="comment" method="post" action="comment.php" onSubmit="return validation()">

 
<table width="500" border="0" cellspacing="3" cellpadding="3" style="margin:auto;">
  <tr>
    <td align="right" id="one">Name :<span style="color:#F00;">*</span></td>
    <td><input type="text" name="namename" id="tnameid"></td>
  </tr>
  <tr>
    <td align="right" id="one">Work :<span style="color:#F00;">*</span></td>
    <td><input type="text" name="job" id="tjobid"></td>
  </tr>
  <tr>
    <td align="right" id="one"></td>
    <td><textarea name="message" id="tmessageid"></textarea></td>
  </tr>
  <tr>
  <td align="right" id="one"></td></center>
<?php
 require_once('recaptchalib.php');
          // Get a key from https://www.google.com/recaptcha/admin/create
$publickey = "6LfFYRwTAAAAAKjhq4QOgfYXZP6aZ6OSJhNBPglV
";
$privatekey = "6LfFYRwTAAAAAIqSCCYHobymWT98Jwooh9EwinjE";
# the response from reCAPTCHA
$resp = null;
# the error code from reCAPTCHA, if any
$error = null;

echo recaptcha_get_html($publickey, $error);
?>
  <td><input type="submit"  name="submit" id="submit" value="Submit Post">
  </td>
</tr>
</table>
</form></center>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

嗯,我刚刚提交后通过重定向解决了问题

在验证码有效回复

之后

c