WordPress.org

Ready to get started?Download WordPress

Forums

why is wordpress redirecting to home page after form submit (4 posts)

  1. alyda
    Member
    Posted 4 years ago #

    Hi, i have a form where i'm trying to append variables to the url. i've found that the following method works on most sites, but it seems since i'm using wordpress i get different results than i want:

    <FORM METHOD="LINK" ACTION="?page_id=40">
                    Lightbox name: <INPUT TYPE="text" NAME="newLB">
    
                    <INPUT TYPE="submit" VALUE="Create">
                    </FORM>

    the action, whether absolute or not, should append the above variable to the page url. this does in fact happen, but instead of reloading the page i want (in this case, page id 40) it redirects to the home page and appends the variables to that url.

    i have tried using <?php echo the_permalink(); ?> and it still does the same thing, redirects to the home page.

    i suppose i could add a "redirect_to" variable to the homepage that would send me back to page 40, but that is slow on the server and seems ridiculous to me.

    isn't there some way i can keep wordpress from sending me back to the index page, when i am clearly asking for the varibles to be appended to a different url?

  2. venkatwp
    Member
    Posted 4 years ago #

    i have the same problem , i am usinS IIS6.0 wordpress. my understanding is this issue is with wordpress settings not the code.

    will update asap i find solution.

  3. Davidc1969
    Member
    Posted 4 years ago #

    IS this installed with the index.php for Word Press in the same directory as your home page? If so, the server is acting as it should. In your code your action is not specifying a page, so the default one for the directory will be used. If this is the case, change the action to ACTION="index.php?page_id=40" and it should work. The way you have it coded should work if WP is installed in it's own sub directory.

  4. malikov
    Member
    Posted 4 years ago #

    What happens if you send an empty form?

Topic Closed

This topic has been closed to new replies.

About this Topic