Kemik Posted July 22, 2007 Share Posted July 22, 2007 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? Quote Link to comment Share on other sites More sharing options...
Kemik Posted July 23, 2007 Author Share Posted July 23, 2007 Bump. For a temporary solution I've just removed the if statements checking if the Su and email are unique. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
trq Posted July 23, 2007 Share Posted July 23, 2007 I cannot use $session->user info['email'] to check against the submitted password. Why? The whole point of sessions is that they are global. If this session class your using is limiting that capability I would suggest you not use it. Quote Link to comment Share on other sites More sharing options...
Kemik Posted July 23, 2007 Author Share Posted July 23, 2007 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']? Quote Link to comment Share on other sites More sharing options...
Kemik Posted July 23, 2007 Author Share Posted July 23, 2007 Oh my... well I'm officially an idiot. I just have to use $this->insertfieldhere. E.g. $this->email instead of $session->user info['email']. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.