close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Updating the profile page "nulls" the user level

Thread began 7/06/2011 8:55 am by jen425288 | Last modified 7/08/2011 11:22 am by Jason Byrnes | 1009 views | 7 replies |

jen425288

Updating the profile page "nulls" the user level

I posted this problem under "Cannot access page even though logged in" six days ago. Jason created a support ticket and effectively closed the thread but since then I have had no help at all from WebAssist. Two nights in a row they told me they would call at about 10pm (I'm in Australia) and two nights in a row I have waited late in the office, but no-one has called. So I'm bringing it back to the forum.

What's happening is that when a user updates their profile, their user level goes to "null" so they can't log back in.

I am attaching a zip of my Profile page here and would appreciate any input. My client is losing patience with me and I really need to get this working.

Thanks!

Attached Files
visitors_Profile.zip
Sign in to reply to this post

Jason ByrnesWebAssist

to allow admins to update the userLevel, you should have a separate set of pages that are accessible to the admin only.

on this page, edit the update record server behavior, and unbind the userLevel column so that it will not be updated.

only on the admin version of the page should the userlevel be updated.

Sign in to reply to this post

jen425288

Thanks Jason, I do have a separate set of pages accessible to admin only, and on this public page I have used show region to ensure that users cannot see or update their user level.

I don't know what "unbind the userLevel column" means - can you please explain? In the meantime I'll have a go - I'll try just removing that whole table row and see if that fixes it.

Sign in to reply to this post

jen425288

OK, I removed that table row and the only reference to userLevel in the PHP at the top of the page, and it now the userLevel does not go to "NULL" when I update the profile (makes me wonder why that column is even included on the page at all?!?)

The server behaviour now says "userLevel does not get a value" so I think that means I've done it right.

BUT... I still get the following error message at the top of the page:

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\AKTN\admin\visitors_Profile.php:14) in C:\xampp\htdocs\AKTN\admin\visitors_Profile.php on line 66

Line 66 is:

header(sprintf("Location: %s", $updateGoTo));

AND... if I change any field (first Name, Last Name or Password), it reverts to the previous value when I click "Submit".

At this stage I'd like to do away with the Profile page completely, but the client wants staff to be able to change their passwords, so that's not an option.

Sign in to reply to this post

jen425288

Not sure if this is a clue, but I uploaded the amended Profile page to the remote server and on that server I don't get the error message. But there's still the problem that the fields revert to the old value upon "Submit".

Sign in to reply to this post

Jason ByrnesWebAssist

i looked at this through the incident that had been created where you gave us ftp access to troubleshoot directly:


it looks like the update SQL was not getting updated properly, it is still referencing the user Level post and using that for the user ID

this code:
$updateSQL = sprintf("UPDATE visitors SET VisitorPassword=%s, VisitorFirstName=%s, VisitorLastName=%s WHERE VisitorID=%s",
GetSQLValueString($_POST['VisitorPassword'], "text"), GetSQLValueString($_POST['VisitorFirstName'], "text"), GetSQLValueString($_POST['VisitorLastName'], "text"), GetSQLValueString($_POST['userLevel'], "int"), GetSQLValueString($_POST['VisitorID'], "int"));

should have been:
$updateSQL = sprintf("UPDATE visitors SET VisitorPassword=%s, VisitorFirstName=%s, VisitorLastName=%s WHERE VisitorID=%s",
GetSQLValueString($_POST['VisitorPassword'], "text"), GetSQLValueString($_POST['VisitorFirstName'], "text"), GetSQLValueString($_POST['VisitorLastName'], "text"), GetSQLValueString($_POST['VisitorID'], "int"));


i fixed it in the visitors_Profile.php page for you and it is now updating.

Sign in to reply to this post

jen425288

Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...