link to pass other login variables to cmsb login

7 posts by 3 authors in: Forums > CMS Builder
Last Post: March 9, 2009   (RSS)

Re: [markr] link to pass other login variables to cmsb login

By Dave - February 25, 2009

Hi Markr,

Yes, you can automatically login with a link like this:
admin.php?username=yourName&password=yourPassword&action=loginSubmit

Note that GET urls such as this (with values in the url) may be logged in your web server's logs and webstats pages, so make sure those are not publicly accessible.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [markr] link to pass other login variables to cmsb login

By markr - February 28, 2009

The link works when I hard code the name and password...

[font "Verdana"]admin.php?username=bob&password=123abc&action=loginSubmit


...but not with php variables...

admin.php?username=<? php echo $username ?>&password...

Will it work with variables?

Re: [markr] link to pass other login variables to cmsb login

By ross - March 2, 2009

Hi Markr

You should be able to do it with those variables. It really depends on what they actually return though. If you are running into trouble with them, my first thought is that the values in those actually have spaces or something in them.

I would make sure that you only get the username and password without anything else in them.

If you wanted to post the link that you get when the variables in there, we could try to troubleshoot it together.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [markr] link to pass other login variables to cmsb login

By Dave - March 2, 2009

I'll just add that the first step is to just get those variable printing out. Try viewing source and seeing what shows in the link.

If you post the link feel free to replace some of the characters so you're not posting your actual username and password...
Dave Edis - Senior Developer
interactivetools.com

Re: [markr] link to pass other login variables to cmsb login

By markr - March 7, 2009

Works great. Clients love this. Your link was fine...I had merely forgotten the echo function.

The full link in case others want to see

<a href="http://www.mysite.com/cmsAdmin/admin.php?username=<?php echo $username ?>&password=<?php echo $password ?>&action=loginSubmit">Page Content</a>

Re: [markr] link to pass other login variables to cmsb login

By Dave - March 9, 2009

Thanks for posting back, and glad to hear it's working! :)
Dave Edis - Senior Developer
interactivetools.com