Skip to main content
Participant
August 12, 2010
Question

MySQL/PHP user login - Any email.

  • August 12, 2010
  • 2 replies
  • 1036 views

Hi there,

I'm such a noob to this, but I have successfully built a PHP website, with the help of many tutorials, and I have uploaded a database to my clients PhpMyAdmin for use on the login page of the website.

The login page is a simple Email and Password form, and it works fine with the allocated email and password my client has chosen, but they have now asked me to make it so any email can be used in the form, but when I go into the table in the database and delete the email and leave it blank, but keep the password only, it doesn't seem to work in the site. Is there a simple way to allow any email in the username/email field of the form? But of course keep the password we've allocated to the password field.

Unfortunately someone else built the database, all I used was the 'Log In User' table from it. I'm not to familiar with the PhpMyAdmin interface.

Thanks!

This topic has been closed for replies.

2 replies

Participating Frequently
August 18, 2010

The login user server behavior requires both a login and password credentials. If you want to only validate the password, you would need to change the script. This can be done quite easily if you are familiar with server side scripting. But of course, the greatly diminishes the security so you need to only due this if security on the site is not a major concern.

CamCoinAuthor
Participant
August 18, 2010

This was actually my next question Bregent. The client has now asked for a password login only, but the standard 'Log In User' behavior I've used in DW requires both login and password, you're right. If you could point me in the right direction into what file I edit that would be a great help! The only connection I can see is the PHP connection to the database.

I've warned my client about the risk of jeopardizing the security of the site but they've said 'Go ahead'.

Cheers,

Cam

Participating Frequently
August 18, 2010

Borrowing from my typo in my other post, I don't 'due' php so I really can't help much with that scripting language. But if it is similar to the ASP/VB scripting that DW generates, I would probably abandon the server behavior completely and just code the entire script by hand. That's because anytime you modify a server behavior script, it renders it unable to be maintained by the DW wizard. How familar are you with php?

Lawrence_Cramer
Inspiring
August 17, 2010

You should have no trouble if you UPDATE the field with another email,  which would be preferable if these fields are supposed to be used for a log in. Deleting the email and leaving the field blank may lead to other application errors, depending on how things are written.

To do what you are asking you may need to open up the database itself and set the field to allow NULL values then delete the emails in this field. But again, I'd advise against this.

--
Lawrence Carmer - *Adobe Community Professional*
http://www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in PHP and ColdFusion

Stay updated - http://blog.cartweaver.com

CamCoinAuthor
Participant
August 18, 2010

G'day Lawrence, thanks for your advice!

I'm going to tell my client to stick to just one default email for use on the site, or a few different ones if they need. I tried setting the field to NULL in the past and it just screwed things up, you're right.

Thanks again!

Cam