close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Glitch with server validation

Thread began 8/30/2011 12:10 pm by iainmacdonald331081 | Last modified 8/31/2011 2:26 pm by iainmacdonald331081 | 1729 views | 8 replies |

iainmacdonald331081

Glitch with server validation

Not sure what's up here - basically its the validation that checks whether or not a username or email address is already being used.

I have three registration forms, and its working fine on two, but not on one.

I've been through it a few times now, and can't see where the issue is - as far as I can tell I have everything in the right place, so hopefully its just something simple I've missed.

Have attached the file below.

Thank you.

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

Jason ByrnesWebAssist

to start with, I need to know which validation is failing.

change the following code:

php:
if ($WAFV_Errors != "")  {

    PostResult($WAFV_Redirect,$WAFV_Errors,"registration10");
  }




to:

php:
if ($WAFV_Errors != "")  {

    die($WAFV_Errors);
    PostResult($WAFV_Redirect,$WAFV_Errors,"registration10");
  }




this will write a coma separated list of numbers to the screen to help me see where to look.

Sign in to reply to this post

iainmacdonald331081

I swapped that code, but it didn't seem to do anything.

Its just the server validation on the email and username fields, so I had been looking around the code:

$WAFV_Errors .= WAValidateUnique("connDatabase",$connDatabase,$database_connDatabase,"users_gsg","UserID","none,none,NULL","".((isset($_SESSION["SecurityAssist_UserID"]))?$_SESSION["SecurityAssist_UserID"]:"0")  ."","Email","',none,''","".((isset($_POST["Registration_group_Email"]))?$_POST["Registration_group_Email"]:"")  ."",true,7);
$WAFV_Errors .= WAValidateUnique("connDatabase",$connDatabase,$database_connDatabase,"users_gsg","UserID","none,none,NULL","".((isset($_SESSION["SecurityAssist_UserID"]))?$_SESSION["SecurityAssist_UserID"]:"0") ."","Username","',none,''","".((isset($_POST["Registration_group_Username"]))?$_POST["Registration_group_Username"]:"") ."",true,3);
Sign in to reply to this post

Jason ByrnesWebAssist

if it did not do anything, then there is no validation failure.

that code will write a comma separated list telling me which validation has failed, if there is not comma separated list, then there is no validation failure.


perhaps, a little more clarification of the issue is in order. Please provide a detailed explanation of what is happening when you test your page versus what you are expecting to happen. all you have said so far is that it doesn't work, that is a very broad statement and does not help me know what i should be looking for.

Sign in to reply to this post

iainmacdonald331081

This is one of the working versions:

trade_registration/

If you try to register using the email address:

iain at handprintwebdesign.co.uk

or username

trademedia

then you get the validation errors saying that they are already in use.

So I'm trying to get it to do the same thing on the page above.

Sign in to reply to this post

Jason ByrnesWebAssist

OK, I understand what you are trying to accomplish, the part you are not explaining though, is how your page does not live up to expectations.

please describe how your tests are different from what you expect to happen.


it may also help to have a copy of the working page.

Sign in to reply to this post

iainmacdonald331081

Will look at this again in the morning - tried a version not requiring a log in, and did get the comma separated list - 7 and 3.

The problem I have is that the validation isn't preventing a new user being added if they are using the same email address or username already used by someone else.

What it should be doing is checking it against the database table, and if the email address or user name typed in the form is already used in the database table, displaying error messages to that effect, as it does on the link above, with the email address or username I posted.

I have attached a copy of a page that does work.

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

Jason ByrnesWebAssist

are you logged in when you test the page?


if you are logged in, and test with the email and username of the logged in user, it will override the server validation.


Make sure that you are not logged in when you are testing this.

Sign in to reply to this post

iainmacdonald331081

Hi Jason - apologies for not posting back earlier.

I think I managed to resolve it - I noticed some difference in some code between the one that worked, and the one that didn't, and changed:

<?php 							
if (ValidatedField('registration10','registration10')) {
if ((strpos((",".ValidatedField("registration10","registration10").","), "," . "3" . ",") !== false || "3" == "") || (strpos((",".ValidatedField("registration10","registration10").","), "," . "3" . ",") !== false || "3" == "")) {
if (!(false)) {
?>



to

<?php 							
if (ValidatedField('registration10','registration10')) {
if ((strpos((",".ValidatedField("registration10","registration10").","), "," . "5" . ",") !== false || "5" == "")) {
if (!(false)) {
?>



Which seemed to fix it.

Somewhere along the way, one of my log in pages now no longer works though...

See adjacent thread...

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