Send to a Friend

webmasterwilliam's avatar

External Link to PHP module execute twice?

Asked by webmasterwilliam (165points) September 22nd, 2008

When I link to a PHP module from an external document, such as an email or word document, the link is executed twice. However, if I execute the link from a browser URL, the module is executed only once, as desired.

For testing, I created the simple module http://localhost/Website/testentry.php which has the following simple code;
<?php
session_start();
$_SESSION[‘testSession’] = “Hello World”;
?>

If I execute if from an external link, the module sets two session files, with the exact same info in it; testSession|s:11:“Hello World”;

If I execute the module from the URL, only one session file is created.

This is just a simple example. My real problem is an application I’m developing having the same problem, where the first entry verifies the presence of a mySql row, and moves it to another table. The second trip can’t find the moved row and signals an error condition.

Does anyone have any suggestions why this behavior is different between submitting an external link versus a URL submission?

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.