WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Form - Action not properly being shown (2 posts)

  1. PHPGator
    Member
    Posted 7 months ago #

    Upon refresh it works fine, but the form is not going to the proper location.

    <?php if ($_GET['a'] == "a") { ?>
       <form class="pure-form" action="<?php echo(network_site_url( '' )); ?>/templatepage?a=doadd" method="post">
       <input type="text" name="name" />
       </form>
    <?php }?>
    <?php if ($_GET['a'] == "doadd") {
       echo("Working!");
    }
    ?>

    Unfortunately the "Working!" only shows when I refresh the page after the form has been submitted. By default from the form it is going back to the home page of the website. Any ideas what the issues could be?

    Note that this is from a template page. I am using $_GET[] to get the variables of whether to pull the form or to verify the form has been submitted. I've tried other methods with no success. I know i'm just overlooking something.

  2. PHPGator
    Member
    Posted 7 months ago #

    Issue is that name="name" is not valid. Whoops!

Reply

You must log in to post.

About this Topic