WordPress.org

Ready to get started?Download WordPress

Forums

Submitting a form on a virtual page (6 posts)

  1. .sarah.
    Member
    Posted 2 years ago #

    I've created a number of virtual pages using add_rewrite_rule

    On one of those pages I need to have an enquiry form. I can generate the form but when it submits to the exact same page I get a "no page found" error.

    I run the add_rewrite_rule everytime on init and I know it's running. My code on "parse_request" can see that the right variables have been extracted from the url.

    What am I missing?

  2. RichardWPG
    Member
    Posted 2 years ago #

    Why don't you use some plugins?

  3. .sarah.
    Member
    Posted 2 years ago #

    Its part of the plugin I'm writing. I'd rather have one complete plugin than cobble several together.

  4. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    Please describe what you mean by using the term 'virtual pages'?

  5. .sarah.
    Member
    Posted 2 years ago #

    Hi

    take a look at sleepouts dot in (temp domain)

    We have regions around the country and each will have customisable contents driven by a plugin. That works as expected using add_rewrite_rule.

    However we have an enquiry/contact form and another 'purchase' form. I've only done the enquiry one so far and it sets up OK but after the form is submitted it comes back via the 404.php template when it should come back via index.php

    When I put var_dumps in my code I can see that the 404 page has access to the $wp->query_vars that the rewrite code parses out so I have all the info I need.

    To a certain extent I don't care that the 404 headers get sent because search engines can't get to the response page but the OCD programmer in me wants to understand why it isn't working :)

  6. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    Please describe what you mean by using the term 'virtual pages'?

Topic Closed

This topic has been closed to new replies.

About this Topic