Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Help pls. (http://www.go4expert.com/forums/help-pls-t20191/)

rekha 25Nov2009 16:24

Help pls.

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.

venami 25Nov2009 22:08

Re: Help pls.
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".

rekha 26Nov2009 10:59

Re: Help pls.

Thanks for your reply.I think it is a complex task.Can't it be done using referral.

venami 26Nov2009 11:59

Re: Help pls.
"Referral" in the sense? Can you explain?

rekha 26Nov2009 12:07

Re: Help pls.
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?

venami 26Nov2009 12:12

Re: Help pls.
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.

rekha 26Nov2009 12:16

Re: Help pls.
Can You post a sample code for me.Let me try if that's possible.

venami 26Nov2009 12:20

Re: Help pls.
What is the scripting language that you are using?

rekha 26Nov2009 12:28

Re: Help pls.

I am using php for setting session variables and javascript for validation and other things.

venami 26Nov2009 12:40

Re: Help pls.
Will try out my code and let you know once it works.

All times are GMT +5.5. The time now is 23:08.