close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Double opt tutorial flaw update page… anyway

Thread begun 7/20/2014 12:48 pm by mrs | Last modified 7/23/2014 12:55 pm by Jason Byrnes | 3618 views | 7 replies |

mrs

Double opt tutorial flaw update page… anyway

On the update page, when I update the info but not the email address, I am getting the email verified change from 1 to 0. Basically, whenever the update page is submitted regardless of what has been updated, the email address doesn't stay verified!

Is there something within the tutorial that I have missed that accounts for the lack of change in the email text field? I have watched the tut again, and the part about updating the users info is at about 30 minutes in. I can't see anything that I have done wrong, but it's highly likely there is.

If I've not done anything wrong then I assume this is just an oversight of an unpredictable problem that arises when developing websites, so is there a way to check the email that has been loaded into the text box still matches that being submitted to the database from the update page to prevent verified emails becoming unverified?

Sign in to reply to this post

Jason ByrnesWebAssist

Send a copy of the page please.

Sign in to reply to this post

mrs

The update page is attached.

I don't know if I am right, but I am thinking that I need to take the if isset code on the second update and add a further condition something along the lines of:

// WA DataAssist Update
if ((isset($_GET['send']) && $_GET['send'] != "" && $row_SecurityAssisttblusers["UserEmail"] != ($_POST["User_Update_group_Email"]))) // Trigger

But that is a complete stab in the dark at this, and as usual, it failed! =D

It can be seen in action at http://mrsgd.com

Thanks in advance.

Sign in to reply to this post

Jason ByrnesWebAssist

I used the FTP info to correct the problem there was a syntax error on line 157.

the end of that line has the following:

$WA_AB_Split . "".(($row_SecurityAssistusers['UserEmai-­l'] != $_POST["User_Update_group_Email"])? '0': $row_SecurityAssistusers['emailVerified']) ."";


$row_SecurityAssistusers['UserEmai-­l']

should be:
$row_SecurityAssistusers['UserEmail']

Sign in to reply to this post

mrs

Ah blimey, I must've hit the hyphen by mistake at some point!

Anyway, that has been misleading as this hasn't fixed my original issue which is the email verification is changing from 1 to 0 even if the email address hasn't been updated. The line in question is on or around 189 which is the second update behaviour, not the first one. Basically, the second update behaviour is looking for the trigger 'send' rather than looking for a change solely to the email address, and as a result it is updating the record to a 0 regardless of any change. I can't where where send is created though!

This is the original trigger:

if ((isset($_GET['send']) && $_GET['send'] != "")) // Trigger

This is what I have changed it to to try to get it to compare the contents of the text box to that of the data passed from the DB, and only if there's a difference should it instigate an update:

if ((isset($_GET['send']) && $_GET['send'] != "" && $row_SecurityAssisttblusers["UserEmail"] != ($_POST["User_Update_group_Email"]))) // Trigger

I've also tried populating a variable like so:

$DBemail = $row_SecurityAssisttblusers['UserEmail'];
if ((isset($_GET['send']) && $_GET['send'] != "" && $_POST["User_Update_group_Email"] != '".$DBemail."')) // Trigger

Nothing is working though. Is this possible?

Sign in to reply to this post

Jason ByrnesWebAssist

that trigger is not where the problem is happeing from, it is not happening in the second update, the problem is happening in the first update.

just fyi, the second update should only occur if "click here to send yourself a new email" link is clicked.


the section of code i highlighted previously is where the problem is happening:

$WA_AB_Split . "".(($row_SecurityAssistusers['UserEmai­l'] != $_POST["User_Update_group_Email"])? '0': $row_SecurityAssistusers['emailVerified']) ."";


This is checking to see if the email sent in the post is equal to the email in the recordset. if they are deferent, it sets the verified column to 0.

the problem is that the recordset name on your page is name "SecurityAssisttblusers", but that code is referencing a recordset named SecurityAssistusers.

i updated that section of code to use the correct recordset name:
$WA_AB_Split . "".(($row_SecurityAssisttblusers['UserEmail'] != $_POST["User_Update_group_Email"])? '0': $row_SecurityAssisttblusers['emailVerified']) ."";


the trigger for the second update behavior should be changed back to the original, as that behavior is not the cause of the problem.

Sign in to reply to this post

anonymous

Ah, yeah, I've been a bit of a tool there haven't I?

Of course the send is related to the sending of the verification email… it all comes flooding back to me now! Apologies for that!!

Anyway, what is this ...Email"])? '0': $row... doing exactly?

I don't know what the question mark or the colon is for; I don't recall ever seeing them in use like this at least anyway!

From what I can tell, it's something like this:

If UserEmail is not equal to User_Update_Group_Email -- question mark does something -- replace 1 with 0 -- colon does something -- to the emailVerified field.

So what is the question mark and the colon doing here?

By the way, adding tbl to the recordset name corrected the problem, so thank you for that.

Sign in to reply to this post

Jason ByrnesWebAssist

it is a ternary expresion which is an if statement short handin the form of;

(condition)?true:false

so in this code:
($row_SecurityAssisttblusers['UserEmail'] != $_POST["User_Update_group_Email"])? '0': $row_SecurityAssisttblusers['emailVerified'])

the question is:
($row_SecurityAssisttblusers['UserEmail'] != $_POST["User_Update_group_Email"])?

or in english:
is the email in the recordset different than the email in the post

the true and false responses are:
'0': $row_SecurityAssisttblusers['emailVerified']

so if the answer is yes, it uses the value 0, if the answer is no, it uses the value that is already stored in the emailVerified column of the recordset

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