Ultradev example tutorial: 5 Make a relatively simple website backend (3)
Author:Eve Cole
Update Time:2009-05-26 16:34:18
Chapter 5: Make a relatively simple website backend (3)
What to do with deleted pages? Huh? Did you forget what we said above? Using the command object, it is very simple:
Test it first. Delete the data we just edited, well, it’s normal--it’s weird if it’s not normal :)
Generally, after we add, delete, or edit data, there will be some prompts, or we need to jump to another page. For example, what should we do if we want to jump back to the data display page after the deletion operation (del_article.asp) is completed? Use the refresh tag in html. Haha, did you suddenly feel enlightened when you patted your head? I keep flipping around in asp and forget all about html.
Insert -> Head Tags ->Refresh, as shown in the figure:
In fact, this jump function is better than the redirect in ASP, because some old browsers or netscape do not support redirect very well, and sometimes cannot jump to the page you want normally. At this point, our editing, deleting, and adding pages are ready. We are now making a function selection page that can jump quickly:
After finishing this, shouldn't we breathe a sigh of relief? Hoho, a simple website background management program has been completed. It's so simple. Wait a minute, your page doesn’t have any protection measures yet! In other words, as long as anyone knows the address of your website's backend management page, he can add, delete, and edit. In this case.... $%^#&*
Haha, we have been prepared for a long time. Don’t forget that we have a dedicated administrator user table to record administrator information!
Open server bahaviors -> Authentication -> Login User to create a password verification page---don't forget, to implement it, you must first create a Form containing several Text type form fields. Only after the verification is passed can those background management pages be accessed!
I believe you will understand the purpose of each column in the picture at a glance. If you don’t understand, it will be clear by looking at the example of the clay figurine:)
After completion, it looks like this:
This alone is not enough, we also have to create a behavior for each page that you do not want to be accessed by unverified people: server behaviors -> Authentication -> Restrict Access To Page. That is to say, if it is not verified, it cannot access. As shown in the picture:
If Access Denied Go To: Which page to jump to if it is not verified. Here is fail.asp.
Looking at the source code, you can see that the protection mechanism uses sessions. When logging in, the server will create a session variable. If you directly access other pages without logging in, you will not be able to access them because the session does not exist:
At this point, a truly relatively complete but relatively simple one is complete! At the same time, congratulations, you are now more proficient in using Ultradev. I believe you can use it to create many feature-rich web applications!
In the last section, we will talk about some advanced application skills of Ultradev, friends, don’t miss it!
If you need more information about ultradev, please visit www.4u2v.com.