Using a plugin to run PHP code inside your content is not the sanest thing to do, especially when said code is not idempotent.
Basically, you cannot guarantee that your code will only run once per page load, since several different things in the system may be processing your content, and thus executing your code, multiple times.
Instead of using Exec-PHP to store the code in the post content, create a Page Template which contains your code, then attach it to the Page in question. Also, rewrite your code so that calling it multiple times doesn’t produce incorrect results (people often double-click buttons and such on the web).
Related Posts:
- How to select WooCommerce products by post_meta and order them
- How to create Loop code for Menu using WordPress?
- Undefined function mysql_connect()
- MySQL column count doesn’t match value count at row 1 [closed]
- Undefined function mysql_connect()
- Fatal error: Call to undefined function mysql_connect()
- Fatal error: Call to undefined function mysql_connect()
- Deprecated: mysql_connect()
- MySQL “Or” Condition
- How to get URL of current page displayed?
- Getting only direct child pages in WordPress with get_pages
- the_date() not working
- How to return number of found rows from SELECT query
- Query multiple custom post types in single loop
- What is This esc_html_e() i wordpress php?
- dbDelta support for FOREIGN KEY
- How can I fetch loop of post titles via AJAX?
- Transaction when using WP functions rather than vanilla SQL?
- Can i use php sql functions instead of $wpdb?
- is it possible to run some php code within a wordpress page?
- Inject post (from specific category) between posts in Loop
- How to correctly submit a search form and display the result in an independent page
- Query both first_name and last_name from wp_usermeta at the same time
- Knowing the total number of posts before to get into the loop
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- How to validate WordPress generated password in DB using PHP?
- How to get the list of WooCommerce product image of a certain category from database?
- get product attributes for current product and store it in a variable
- How to use update and delete query in wordpress
- How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table
- Custom query to get post names beginning with a digit
- Build a content and excerpt grid loop with paging and options for # of posts
- How to make WordPress plugin check for database changes and then do something?
- Custom SQL query to get List of posts with featured image url
- How To Make Connection To WordPress Data Base In A Plugin?
- How to add query vars with paginated URLs?
- Changing user_nicename
- Does WordPress cache get_user_meta() results?
- Displaying post per day
- WordPress will not operate correctly
- How to Join two tables from separate databases within WordPress
- Installing wp3.2.1 on IIS; getting empty sessions
- Guidance with The Loop for CMS
- tag search using WP_Query
- simple wordpress ajax plugin not working when not logged in
- Delete post revisions on post publish
- Display only text to WordPress loop without loosing the text formatting
- How to loop over custom fields in a page template?
- Jquery ajax to custom php file: returning blank data
- How to add active class to custom menu using while loop and wp_list_pages
- Want to separate sections of posts. Can you restart loop?
- Add value to usermeta without removing previous values?
- Using Echo in ShortCode – Stuck
- Problems migrating WordPress to localhost
- Print html when custom field has value inside while loop
- Alter secondary loop to exclude posts from current page category
- Show only one post for each author ( Page loads too slow )
- error importing localhost export file to server
- Post from one loop in different containers?
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- Custom Loop Pagination on WordPress
- How to sort results from a custom database table
- Install will not load: PHP does not have MYSQL installed
- Specific Loop For 2 Within Each
- Update some database fields when post is saved
- How can I call a row of user specific data from a custom table added to the WP Database
- delete an array element when its date expires
- Two posts in same div – WP loop
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Insert post without actions/hooks
- Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- User Defined order on get_categories?
- How to merge local and live databases?
- How to track a users progress through pages by inserting data into WordPress Database?
- Woocommerce, recognize the loop of related products
- the_author_meta not working
- Store loop into array
- Import 10,000 Users into WordPress WITH a specific ID for each user
- Looping through WP_Post Object
- Modern Tribe Calendar wp-query with meta query not working at all
- WordPress loop specific thumbnail size
- WP database error for comments_popup_link()
- if statement on database query
- get understrap pagination to work with custom query
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- Successful or Error Message after running mysql code in functions.php
- sql query to put quotes around numbers in img tag
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Displaying Only Certain Tags in Loop
- No wp-config.php file on local install of wordpress – site still displays
- Use ajax to update_post_meta
- Easiest way to show total number of subpages
- How to get the post_id from postmeta
- Sortable admin column for one meta key with three possible meta values
- WordPress Ajax Custom Query – High CPU LOAD
- AJAX in WordPress, sending coords data to MySQL and show after into map