Title: Code executing twice
Last modified: August 19, 2016

---

# Code executing twice

 *  [eastsidedev](https://wordpress.org/support/users/eastsidedev/)
 * (@eastsidedev)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/code-executing-twice/)
 * I have a page that executes a PHP script. Page content is very simple:
    <?php
   include “myscript.php”; ?>
 * myscript.php has code that loads a form (code piece 1), and then some more code
   that executes when the form is submitted (code piece 2). The problem I’m running
   into, is that Code piece 2 is executing twice. I checked and double checked my
   code, and there’s no chance that I have a loop that executes twice. Code piece
   2 checks to see if a piece of data is in the database, and if it’s not, insert
   it. As a result of the double execution, the answer is yes, it’s in the database
   every single time.
 * Theme is thesis_18. Any ideas?

The topic ‘Code executing twice’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [eastsidedev](https://wordpress.org/support/users/eastsidedev/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/code-executing-twice/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
