我有一个问题,一个 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);
?>