php-get在通过代理连接时运行两次


php get runs twice when connecting through proxy

我遇到一个问题,php页面运行两次,但通过代理服务器连接时只运行两次。如果用户没有通过代理进行连接,则此代码运行良好。

如何修复此问题,使其仅运行一次,无论是否通过代理连接

此php代码在Drupal CMS页面中运行,但独立于Drupal。用户通过单击超链接来访问此页面。

是不是我正在使用页眉将用户重定向到另一个页面?

<?php
$userId = 0;
$userId = $_GET["userId"];
$userEmail = 0;
$userEmail = $_GET["userEmail"];
$userName = 0;
$userName = $_GET["userName"];
//connect to the database
$con = mysql_connect("HOSTNAME","USERNAME","PASSWORD");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
else
{
//echo "Connected.";
//echo "<br>";
}
mysql_select_db("formredirectdata", $con);

$userId = intval($userId);
mysql_query("INSERT INTO webforms
(userid, formisactive, formname, formtitle, shortdesc, confirmationlink) VALUES('$userId', '1', 'Form Name', 'Form Title', 'Short Description', 'Confirmation Link') ") 
or die(mysql_error());  
$newformnum = mysql_insert_id();
$recipientname = 0;
$recipientemail = 0;
$recipientname = "default" . $newformnum;
$recipientemail = $userEmail;
//send to the next script
header('Location: addtriggernewform.php?formnum2=' . $newformnum . '&recipientemail=' . $recipientemail . '&operator=(default)&inputname=(default)&triggervalue=(default)&userName=' . $userName);
?>

我后来发现,查询被处理了两次的原因是我使用不同的用户帐户在两个不同的浏览器中登录了该网站(基于Drupal(。在其中一个浏览器中注销后,查询不再被处理两次。这一定是一个涉及Drupal和临时互联网文件的怪癖。