Conditional programming with WebDNA
numero = 154[showif [date %A]=Friday]Today is the last day of work this week![/showif]If your server's clock is on time, and if the day is really Friday, you will see the message. Otherwise, you will see.... nothing.What if we want to see a message if today is NOT Friday? Several ways:
[showif [date %A]=Friday]Today is the last day of work this week![/showif][showif [date %A]!Friday]Too bad![/showif]Here "!" means "different from", or "is not equal to".And now we find something extremely interesting with WebDNA: you have several ways to do the same thing, because WebDNA is very flexible. You can do exactly the same thing with this code:
[showif [date %A]=Friday]Today is the last day of work this week![/showif][hideif [date %A]=Friday]Too bad![/hideif]or using an if/then style statement:
[if "[date %A]"="Friday"][then]Today is the last day of work this week![/then][else]Too bad![/else][/if]
[showif [date %A]=Friday]
Today is the last day of work this week!
[/showif]
[showif [date %A]=Friday]
Today is the last day of work this week!
[/showif]
[showif [date %A]!Friday]Too bad![/showif]
[showif [date %A]=Friday]
Today is the last day of work this week!
[/showif]
[hideif [date %A]=Friday]Too bad![/hideif]
[if "[date %A]"="Friday"]
[then]
Today is the last day of work this week!
[/then]
[else]
Too bad!
[/else]
[/if]
DOWNLOAD WEBDNA NOW!
...
WebDNACodeSparker FRAMEWORK by GovindaI am glad to help the beginners...
7. Searching DatabasesSearching databases with WebDNA and conclusion...
4. Password ProtectingHow to password-protect a page using WebDNA...
5. Writing FilesHow to write a file using WebDNA...
2. Conditional ProgrammingConditional programming with WebDNA...