close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Check Age With SeverValidation

Thread began 10/19/2009 12:55 pm by Cologne | Last modified 10/20/2009 10:47 am by Cologne | 3919 views | 8 replies |

Cologne

Check Age With SeverValidation

Hi,

how can I check (serverside) the age with VTK2?

I got the field "birthday" dd.mm.yyyy this the Fomat I check it against. Now I want th faile if the age is under 14 years. So it must be the field min. Date.

But what do I put in there to check if the birthday is older that 14 years?

Cheers
Denis

Sign in to reply to this post

Jason ByrnesWebAssist

use this for the minimum date:

php:
<?php echo(date("d/m/Y"mktime(000date("m"), date("d"), date("Y") + 14))); ?>
Sign in to reply to this post

Cologne

Jason,
that does not work :-(

register.php

Sign in to reply to this post

Jason ByrnesWebAssist

Rather than just say it does not work, it would be more helpful if you could describe the scenario that you are testing that does not work for you.


it seams to work for me.


If I enter:
21.10.2023


it will validate the date

If I enter:
14.10.2023

it will not.


If you could describe what you are expiring, it would take out the back and forth of having me test something different.

Sign in to reply to this post

Cologne

Hi,

<?php echo (date("d.m.Y", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y") - 14))); ?>



does not work.

if you are born 20.10.1995 you can enter, if born 21.10.1995 then NOT.

so the date must in this case be earlier that 20.10.1995


how to check that?

thanks,
Denis

Sign in to reply to this post

Jason ByrnesWebAssist

Ok, so the math was backwards. Instead of 'date("Y") + 14" use "date("Y") - 14"

php:
<?php echo(date("d/m/Y"mktime(000date("m"), date("d"), date("Y") - 14))); ?>








much easier to tell what "doesnt work" when I know "whats wrong"

Sign in to reply to this post

Cologne

no, that does not work, too.

I put that into min Date:

<?php echo (date("d.m.Y", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y") - 14))); ?>



that is exactly the diffrent I want. now you can enter if you a born BIGGER that 20.10.1995.

but then you are younger.

you only should enter if you are born before 21.10.1995

i dont know how to tell.

Sign in to reply to this post

Jason ByrnesWebAssist

That should go in the maximum date.

Sign in to reply to this post

Cologne

YES!

Thats it, great!

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