Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4552294
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:45:50+00:00 2026-05-21T16:45:50+00:00

I built a contact form in PHP inside a WordPress page, using the exec-php

  • 0

I built a contact form in PHP inside a WordPress page, using the exec-php plugin to val and run the code. However, the WordPress rewrite system seems to override the POSTed form data being sent to the page. Is there any way to ensure that this data gets passed through? All I have in my ,htaccess is the standard WP rewrite block.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:45:51+00:00Added an answer on May 21, 2026 at 4:45 pm

    Yes you can access forrm POST variables in a page of WordPress.

    I created a page template like this:

    <?php
    /*
    Template Name: Page with Form
    */
    ?>
    
    <?php get_header(); ?>
    <div id="content" class="widecolumn">
     <?php
     var_dump($_POST);
    
     if (have_posts()) : while (have_posts()) : the_post();?>
     <div class="post">
      <h2 id="post-<?php the_ID(); ?>"><?php the_title();?></h2>
      <div class="entrytext">
      <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>');?>
      </div>
     </div>
     <?php endwhile; endif; ?>
     <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    </div>
    <form id="test" method="post">
       <input id="srchbox" name="term" size="28" value="" type="text">&nbsp;
       <input name="submit" value="Submit" align="absmiddle" type="submit">
    </form>
    <?php get_footer(); ?>
    

    Then I created a page through WordPress admin panel and used above page template.

    You can see I have a sample form “test” in this page template. Now when I visited the newly created page in my browser and entered some text in form and submitted the form I got this for var_dump($_POST); line:

    array(2) {
      ["term"]=>string(7) "foo-bar"
      ["submit"]=>string(6) "Submit"
    }
    

    As you can see WordPress doesn’t interrupt anything and your page has full access to your $_POST array for Form POST variables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I built contact form in aspx 3.5 and I'm using jQuery to send it
i have bought a template that have built in contact form problem is that
I have a contact form i want to use Ajax for. My contact.php script
I want to build my WP theme with a built in contact form. Something
I built a template-based document generator using the Open XML SDK (1.0) , the
Does C# have built-in support for parsing strings of page numbers? By page numbers,
this may seem trivial but I'm setting up, on a profile form page I'm
Outline I'm building a form for a specific page, where users can make suggestions
Another question about Drupal webforms -- The form itself is built in by /includes/form.inc
I'm setting up a contact form, but I have some saved information in some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.