WordPress.org

Ready to get started?Download WordPress

Forums

Form Submit Changes Current Page to Homepage (1 post)

  1. lieutenantdan
    Member
    Posted 1 year ago #

    Hey all,

    I have a form which is a contact form, but when it gets submitted it stays at the same URL, yet the page changes to the homepage... I'm not sure what I did to make it stay on the same page after the form was submitted, but it used to stay on that page a couple of times when I was playing around with it.

    Form Action
    <form action="<?php the_permalink(); ?>" method="POST">

    Then I just put a if(isset($_POST['submitted'])) to see if the form was submitted, and it has been, i put this code on both the homepage and the contact page.

Topic Closed

This topic has been closed to new replies.

About this Topic