0

I am trying to let the user login via my own table that I created in phpmyadmin. I also am using an insert php plugin so that I can insert php into my code. How can I make it so the user can see a custom navigation menu bar when I have confirmed the user has logged in? I don't want to use a plugin because my login for users is not a wordpress login, but rather my custom login? I don't know much about wordpress php files, I am using a scribbles wordpress theme, and editing via cpanel in godaddy. It seems wordpress is getting in my way of wanting to edit this nav bar on the fly, where can I go to edit this? Thank you.

an example of what I have...

 <p>Please enter your username and password to login</p>

    <form action="" method="post">
        Username : <input type="text" name="my_user"/>
        Password : <input type="text" name="password"/>

        <input type="submit" class="submit_button" value="Login" />
    </form>
  [xyz-ips snippet="Login"] //this is the snippet that calls php code       

<a href="https://mathtutortime.com/forgot_password/" style="font-size:18px;font-weight: bold; font-family: Arial, Helvetica, sans-serif;color:Blue">Forgot Password</a>

//part of [xyz-ips snippet="Login"] php snippet using 'insert php'

if ($username == $username_in_db && $password == $password_in_db)
     {
         echo 'you are logged in now!';
         //code that would forward user to a secure page that has its own 
         custom navigation bar
     }
else
   {
    echo 'you entered the wrong info';
  }
  • 1
    why don't you use WP user table? To affect single menu items you can use 'wp_nav_menu_items' filter or to render a different menu use 'wp_nav_menu' in your template if user is logged in. Btw... writing login forms is NOT trivial. without e.g. sanitizing or using wp nonce you will be hacked within the blink of an eye. – Pat_Morita Apr 7 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.