ASP: The Beginning - Naming Conventions
(Page 4 of 4 )
When you name a variable, you must follow certain rules, or conventions. Here they are in a nifty little list:
The name must start with a character from the alphabet (a through z or A through Z).
You cannot use a period in the variable name.
No two variables can have the same name within the same scope. Really, it is best to avoid naming two variables the same.
A Brief Example of Sessions in ASP
While we do not have time to cover Sessions in-depth in this article, I would like to go over how one looks briefly (we will discuss Sessions and Cookies in the next tutorial). Here is a simple code to read what time the user visited the website and greet them:
<html>
<body>
<%
Session(“TheTime”) = Time()
response.write(“Greetings nerdlings! Welcome to my humble abode. The time is currently: “ & Session(“TheTime”))
%>
This will display:
Greetings nerdlings! Welcome to my humble abode. The time is currently: 12:10:19 PM.
Well that is all the time we have for this exciting episode. In the next article we will be discussing cookies (yummy) and sessions, and how to work with them. So be sure to drop on by for a spell. Maybe you can even take a swim in our concrete pond.
Till then...
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |