close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

On Server Side Validation "Not Like Entry"

Thread began 8/09/2011 1:11 pm by neo314 | Last modified 8/09/2011 6:08 pm by neo314 | 1169 views | 2 replies |

neo314

On Server Side Validation "Not Like Entry"

This message is for Ray,

I was looking into Server Side Validation "Not Like Entry" and came upon this thread: forumdisplay.php?f=28

In it, you posted:

  I suppose you could do it with a little php...

Use required validation on :

<?php echo((isset($_POST['firstField']) && isset($_POST['lastField']) && strtoupper($_POST['lastField']) == strtoupper($_POST['firstField']))?"fail":""); ?>

that should fail required validaiton if the two fields were the same... just a warning though... I knew a kid named "Jackson Jackson" in high school.  



This confuses me a bit. Could you please explain. If the 2 fields are the same, this statement outputs "fail" which should pass required validation right? fail is an input, BUT if the two are not the same it outputs "" which should fail required validation. Am I missing something.

It would be nice if this feature were added to validations without having to resort to trickery.

Sign in to reply to this post

Jason ByrnesWebAssist

in the example given, "failed" is just a string used to pass validation. the string can be replaced with anything. it could be replaced with "passed", "123" or even "donald duck".

<?php echo((isset($_POST['firstField']) && isset($_POST['lastField']) && strtoupper($_POST['lastField']) == strtoupper($_POST['firstField']))?"123":""); ?>
Sign in to reply to this post

neo314

That is what I thought, but I believe the logic is backwards for "Not Same As" validation. I just debugged mine and my belief seems to be correct.

If the statement is true, and they are the same it should fail so it should be ...)?"":"123";

I just finished debugging mine. I am doing something a little different, but the same general idea. I'm using file with overwrite as the option for same file names, so I create a recordset that searches existing fields for the posted file name and use your method for checking that the posted file name is not already in the database (on the update page it will have to screen out the record being updated WHERE ... AND id != $_POST["WADAUpdateRecordID"])

The statement I am using which is working for this purpose is:

<?php echo((isset($_FILES["musicfile"]) && ($_FILES["musicfile"]["name"] == $row_filecheck["musicfile"]) && ($totalRows_filecheck > 0))? "":"Pass"); ?>
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...