singapore: the smallest big galery
home » forum » General » automatic login

You are not logged in.

#1 2010-02-04 15:05:41

lawrie
Member

automatic login

Hi,
I had this working on an old site:

<form action="http://www.mydomain.co.uk/gallery/admin.php" method="post" name="form2" id="form2">
            <input name="Submit" type="submit" class="admin_button" value="gallery">
            <input type="hidden" name="PHPSESSID" value="674ef4579ad8bf616c6cff4e65f6cb8c" />
            <input type="hidden" name="action" value="login" />
            <input type="hidden"  name="sgPassword" size=8 value="mypassword">
            <input type="hidden"  name="sgUsername" size=8 value="myname">
        </form>

Tried it on a new site and it only gives the login page.

I want it as the link is from a secure CMS and I only want one login.

Any advice

Thanks
Lawrie

Offline

 

#2 2010-02-06 04:42:32

DC
Administrator

Re: automatic login

Not sure I understand what your saying?
You want it as a link.

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#3 2010-02-06 15:45:52

lawrie
Member

Re: automatic login

I want the link from my CMS (secure) to pass the username and password of the gallery admin to admin.php and take me straight into the admin area without having to login to the gallery.

Last edited by lawrie (2010-02-06 15:47:17)

Offline

 

#4 2010-02-06 17:32:02

DC
Administrator

Re: automatic login

Try setting the passwords and user the same in each
and then set the session to use the same session as a alphanum or somthing you make up.


session_name('EN34562');
must be numbers and letters ...

Try placing that before the session start in your scripts.

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#5 2010-02-07 00:17:56

lawrie
Member

Re: automatic login

DC wrote:

Try setting the passwords and user the same in each
and then set the session to use the same session as a alphanum or somthing you make up.


session_name('EN34562');
must be numbers and letters ...

Try placing that before the session start in your scripts.

DC

Thanks.
I use the same username & password.

I have used:
$session_path = ini_get("session.save_path");
if(!is_writable($session_path)){
$mypath = $_SERVER['DOCUMENT_ROOT'];
$mypath = str_replace(".","",$mypath);
session_save_path ("$mypath/tmp/");
}

In admin.php

Where would I put :
session_name('EN34562');

in the scripts to set the session
(out of my comfort zone here smile
Lawrie

Offline

 

#6 2010-02-07 00:35:37

PrimaFoto
Moderator

Re: automatic login

Try putting it in the top of external.php - file in the root dir.

Pretty sure this would do it.


A Junior Scientist of the SGAL - Lab
http://sgal-lab.primaveraphoto.com

Offline

 

#7 2010-02-07 09:00:41

lawrie
Member

Re: automatic login

Like a charm,
thanks guys :-)

Offline

 

#8 2010-02-07 18:02:03

DC
Administrator

Re: automatic login

No problem but make sure you set that to whatever you want, another words  no one should know what the alphanumeric ses name is, so make one up yourself, I only gave you that number as an example so change it where ever you have it to your own secret alphanumeric characters.

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#9 2011-03-04 05:02:16

alexsmth114
Member

Re: automatic login

(Try setting the passwords and user the same in each
and then set the session to use the same session as a alphanum or somthing you make up.


session_name('EN34562');
must be numbers and letters ...

Try placing that before the session start in your scripts.

DC) I tried this way and it was working fine for me!!..

Offline