Help pls.

rekha's Avatar
Contributor
Hi,

In my site I am having a demo login.I processed all the code in one page.If there is empty session then I use demo login id to login.But I want this to make work only if I click the demo login button.
How can I do this.
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
As you will use session variables to store the session details, you can also use a variable to enable or disable the "demo login". Set the default value of the variable to "no". If you press the demo login button, change the value of that variable to "yes". While logging out of the "demo login" session by pressing logout, change the value of that variable again to "no".
0
rekha's Avatar
Contributor
Hi,

Thanks for your reply.I think it is a complex task.Can't it be done using referral.
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
"Referral" in the sense? Can you explain?
0
rekha's Avatar
Contributor
If the link is in the index page and if i click the link it should go to demo login.If I directly type the url in the address bar it should not go.

How to do this?
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
I don't know whether there is any other way than what I have mentioned in the previous posts. But let me know if you find another way

I was using only session variables for such purposes earlier. It was not much difficult for me to do. Just lesser than 5 lines of code.
0
rekha's Avatar
Contributor
Can You post a sample code for me.Let me try if that's possible.
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
What is the scripting language that you are using?
0
rekha's Avatar
Contributor
Hi,

I am using php for setting session variables and javascript for validation and other things.
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
Will try out my code and let you know once it works.