Jump to content

[SOLVED] Checking if user info has changed


Kemik

Recommended Posts

Hello,

 

I'm making a useredit.php script but I'm finding a certain area difficult. I want the user to be able to edit their email address and "SU" (Steam Username). However, both fields must be unique. E.g. If they're changing their email from the one in their profile they must change it to something that isn't already in the database. My current script brings up that the email is not unique as it finds the email attached to the user's account.

 

At the moment the useredit.php pulls the users info from the database via class variables in session.php. I tried making an IF statement: if  ($session->userinfo['email'] != $subemail) { $database->updateUserField($this->username,"email",$subemail); }

 

However, because all of the error checking (and the above IF statement) takes place in session.php I cannot use $session->userinfo['email'] to check against the submitted password. Is there any other way to do this?

Link to comment
https://forums.phpfreaks.com/topic/61302-solved-checking-if-user-info-has-changed/
Share on other sites

I'll give you a bit of info of how much form is submitted.

 

1. Form on useredit.php

2. process.php - sends all submitted forms to the correct functions, manages errors send back

3. session.php via $session->editAccount() - Verifies form data and forwards data to database.php

4. database.php via $database->updateUserField() - Updates the table and tells process.php if it was successful.

 

As you can see, all the major processing of the form takes place in session.php. I thought $session->userinfo wouldn't work if it was being executed in session.php. Would I have to just use userinfo['email']?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.