I have an issue where a php page which runs twice, but it only runs twice when connecting through a proxy server. This code runs fine if the user doesn't connect through a proxy.
How do I fix this so that it will only run once, whether connecting through a proxy or not?
This php code is running within a Drupal CMS page, but independent of Drupal. The user gets to this page by clicking on a hyperlink.
Is it that I am using header to redirect the user to another page?
<?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);
?>