WordPress.org

Support

Support » How-To and Troubleshooting » why is wordpress redirecting to home page after form submit

why is wordpress redirecting to home page after form submit

  • 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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    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.

    What happens if you send an empty form?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘why is wordpress redirecting to home page after form submit’ is closed to new replies.
Skip to toolbar