Jump to content

Recommended Posts

I'm extremely new to PHP and imagine I'm going to quickly become a regular on here.

 

I'm trying to learn to create a member's login. I've taken a few tutorials to learn MySQL, PHPMyAdmin etc etc not important.

 

I'm currently building and figuring out/modifying this member script. All is going relatively well until I try to put both a sign in and register form on the same page.

 

The problem is that whenever an error message pops up (like the user leaving a field blank) both forms show the error message. Also, the error message is different depending on which form was clicked but they always show up in the "username" and "password" sections of both forms. Can anybody explain to me why this is or how to fix it?

 

I tried to tinker with it creating two different processing files and messing around in the session.php file but I can't figure it out. I assume they're connected by a common element such as sharing a name or something but I really cannot seem to wrap my head around it.

 

If anybody can explain to me what's happening I'd really appreciate it so I can know how to fix it since I plan to have multiple forms on other pages too. On top of that it's also causing formatting issues  which I don't understand why, but I'll figure that out on my own after I learn how to disassociate the form errors from each other. I can fill out both forms no problem, I just can't make any errors when doing it or everything goes wrong.

 

Thanks in advance to anyone who helps me figure this out.

Link to comment
https://forums.phpfreaks.com/topic/205676-multiple-forms-and-error-messages/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.