• I have created a simple template for a page that calls getheader() and getfooter() with the content and code inbetween. The page displays fine.

    However, when trying to use a script that works just fine outside of WP I run into a problem. And no- there should be no conflict with WP functions ect. Its a rather simple script summarized below:

    if $_POST data exists :
    process data
    else :
    display form

    When I first visit the page, the form displays as it should, however when I fill it in and submit, all I get is the message: “Sorry, no posts matched your criteria.” where the content should be. Its as if WP thinks I was trying to do a search. However, I have made sure the POST variables do no match any used in WP. It would seem that WP is highjacking my POST data and not allowing my script to access it. Any idea if and how this is possable?

    As a side note, prior to WP templating system (I forget which version exactly), I creating somthing similar and although I included WP in the page I had no problems.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter waylan

    (@waylan)

    It may help to add that I created my template along the lines of this tutorial, although the actual code contained within is very different.

    Thread Starter waylan

    (@waylan)

    I have wrapped my content in
    <div id="content" class="widecolumn">
    </div>

    and noted that the “Sorry, no posts matched your criteria.” message is as well. I tried adding content outside of my if statement within that div and while is appears when viewing the blank form, it does not when I get the unwanted message. I also added another class to the div, which does not appear when viewing sorce of the message. It would appear that upon receiving the POST data WP is ignoring the template. It occured to me that the rewrite rules could be causing a problem, but then I remembered that I’m not using mod-rewrite in my test box (thats another story for another day). I even entered a word in each of my form fields that I know returns a potative result in search and still got the same message.

    I’m running out of ideas. Any help would be greatly appreciated.

    Thread Starter waylan

    (@waylan)

    I realize I could submitt the data for processing to a seperate file (much like comment submision whithin wordpress) but I’d rather not. I would still need to redirect after processing and indicate to the template script success or failiure so the proper messages could be displayed. It would be so much easier to just have everything in one file that submits to itself.

    I’m having the same issue, I’ve determined that wp-blog-header.php is responsible by placing an echo $_POST[] above and below it… why this deleting my variable I can’t fathom

    anyone? Please!

    I do not have an answer to your problem, however I would really like to know how to create a form, and a submit-form-button whitin a wordpress page.
    Do you have any pointers on where to look?

    Thanks, and sorry I can not return the favour.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘access $_POST[data] in custom page template.’ is closed to new replies.