user2071377
user2071377

Reputation:

my form failed to be submitted

I have the following code which works by itself but when I try it on wordpress, it shows the login but when I click on submit, it does not submit the form, and goes to following address and shows a white page.

    http://localhost:8080/wordpress/wp-admin/admin.php


    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
              Username <input type="text" name="username"  />
              <br /> 
              Password <input type="password" name="password" />
              <br />
             <input type="submit" value="Login" />

    <?php 
        if(isset($_POST["username"])
        ....

Upvotes: 1

Views: 117

Answers (2)

Prabu
Prabu

Reputation: 384

Add name attribute in the form field

<form method="post" name="form_name" action="<?php echo $_SERVER['PHP_SELF']; ?>">

Upvotes: 0

Leon Rowland
Leon Rowland

Reputation: 61

You should perhaps go into more detail of what you are trying to achieve.

Any reason you are not using wp_login_form()?

As for the white screen, I would also recommend to turn on debugging, inside your wp-config.php file is the line define('WP_DEBUG', false); . Change that to true. ( I can only also assume the login showed a white screen because of missing nonce fields, which would go away with using wp_login_form() )

Upvotes: 1

Related Questions