Note that there are some explanatory texts on larger screens.

plurals
  1. POMy PHP calls are not being made in the right order
    primarykey
    data
    text
    <p><strong>UPDATE</strong>: Having read all of your advice I tried using !isset() but that does not seem to work either.</p> <p>If there are 4 calls to the PHP file it seems they must all arrive at the same time so when I perform</p> <pre><code>if(!isset($_SESSION['element_01']) ){$_SESSION['element_01'] = "Something";} </code></pre> <p>it seems 2 or 3 of the calls all find $_SESSION['element_01'] unset!</p> <p>There must be a solution to this!</p> <p>============================================================================</p> <p>I have an application that makes several calls to a php file from the</p> <pre><code>&lt;img src="myfile.php" /&gt; </code></pre> <p>Here is an example:</p> <pre><code>&lt;img src="http://myserver.com/demo/?element=1" &gt;&lt;/img&gt; &lt;img src="http://myserver.com/demo/?element=2"&gt;&lt;/img&gt; &lt;p&gt;Check out our amazing site for everything we offer&lt;/p&gt; &lt;img src="http://myserver.com/demo/?element=3"&gt;&lt;/img&gt; &lt;img src="http://myserver.com/demo/?element=20"&gt;&lt;/img&gt; </code></pre> <p>When I send the element value to the error_log as each makes their call to my index.php file I get the following in my php_error.log: (NB: They seem to be in random orders)</p> <pre><code>[17-Nov-2013 12:53:54] Element = 2 [17-Nov-2013 12:53:54] Element = 1 [17-Nov-2013 12:53:54] Element = 20 [17-Nov-2013 12:53:54] Element = 3 </code></pre> <p>The thing is I rely on element=1 being called first as I an storing a session and using the $_SESSION['element_01'] as a guide for the others but because they seem to reach index.php in random orders this is causing PHP errors such as:</p> <pre><code>PHP Notice: Undefined offset: -1 in http://myserver.com/demo/index.php on line 133 </code></pre> <p>Many users can be arriving at the example web page at the same time, just in case that makes any difference.</p> <p>So to my question:</p> <ol> <li>Is there a way around this or is there a way to ensure they are called in the right order? Something I am doing wrong maybe?.</li> </ol> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload