Help pls.

Contributor
25Nov2009,16:24   #1
rekha's Avatar
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.
Ambitious contributor
25Nov2009,22:08   #2
venami's Avatar
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".
Contributor
26Nov2009,10:59   #3
rekha's Avatar
Hi,

Thanks for your reply.I think it is a complex task.Can't it be done using referral.
Ambitious contributor
26Nov2009,11:59   #4
venami's Avatar
"Referral" in the sense? Can you explain?
Contributor
26Nov2009,12:07   #5
rekha's Avatar
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?
Ambitious contributor
26Nov2009,12:12   #6
venami's Avatar
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.
Contributor
26Nov2009,12:16   #7
rekha's Avatar
Can You post a sample code for me.Let me try if that's possible.
Ambitious contributor
26Nov2009,12:20   #8
venami's Avatar
What is the scripting language that you are using?
Contributor
26Nov2009,12:28   #9
rekha's Avatar
Hi,

I am using php for setting session variables and javascript for validation and other things.
Ambitious contributor
26Nov2009,12:40   #10
venami's Avatar
Will try out my code and let you know once it works.