ssi login function coding problem

Started by silverdragonrs, June 16, 2006, 06:56:58 PM

Previous topic - Next topic

silverdragonrs

I need to know if there is any way for me to use the login function in the way that i want.....

my site makes use of iframes... i have my main index with menu and top bar tables as well as a small copywrite bar at bottom... and then an iframe showing the content of my various pages...

i have called the ssi login function at the bottom of the main menu... so that users may log in as soon as they enter my site.. but once you do it takes you to the main index of the forum...

what i need is for it to log you in but return you back to where you were.. or log you in and take no other action at all...

how can i do this? i am sure this has already been covered but i can't find it anywhere... been searching ssi login and such all day.....

thanks,
danny
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

spottedhog

In RC2, at least, these are equivalent:

$_SESSION['login_url'] = 'http://www.example.com/';
ssi_login();


And:

ssi_login('http://www.example.com/');

It's just a short cut.  The same goes for logout.

------- another way that redirects to exact page --------------
<?php
$current_url 
$_SERVER['PHP_SELF']; 
ssi_login($current_url); 
?>

silverdragonrs

ok... so does anyone know how to get the welcome and logout to work if your site and forum are on seperate servers? i own both servers... so setting up some kind of remote connection is doable ( dont know how but will figure it out if this is doable) .. so asuming i can access the database from the site computer how would i make it so that the users could log in and out and the welcome would work from the site index....

thanks,
danny
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

H

There are multiple ways of doing this.

I'll list the easiest way. In order for this to work the two sites need to be on the same domain (e.g. server1.mydomain.com and www.mydomain.com) and for speed the servers should be located near each other.

Copy the forum files (not db) to the second server and use repair_settings.php to correct the db and paths. Then you can use SSI as normal
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

silverdragonrs

thanks... not going to work in this case i do not believe.. i am using no-ip domain/ip masking service... i am not sure but am pretty sure that the "server1".mydomain.com portion of your solution is for paid customers only... :( (i really need a job :( darn-it) oh well.... you got another one? :)

QUESTION: the reason this feature is not working is because the cookie is set for mydomain.com but i am calling the ssi from myotherdomain.com.... correct? so if i was running both servers on one domain name with a prefix depicting one local from the other... then the cookie should still function for both servers correct? no extra forum setup.. right? i really am not sure how that works which is why i ask ;) )

thanks, danny
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

silverdragonrs

ok... i am going to give up on that idea perhaps... and just move my site over to the other server and set up the vertual host... i was hoping to avoid that but oh well.... a mons got too doo wot a mons got too doo..

thanks for you help..
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

H

QuoteQUESTION: the reason this feature is not working is because the cookie is set for mydomain.com but i am calling the ssi from myotherdomain.com.... correct? so if i was running both servers on one domain name with a prefix depicting one local from the other... then the cookie should still function for both servers correct? no

Correct ;)

(sub-)Domains cannot read cookies from other (sub-)domains
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

silverdragonrs

ok... now wait a sec... i dont understand something... if i created a page on the forum sever that held all the ssi includes and such... why couldnt i include those files...  example

files on server one....

forum
logininclude.php (a file that simply calls the ssi.php and the login function and logout function)

files on server two....

site index... containing an include for logininclude.php...


since the source of the ssi call is on the same domain as the forum shouldn't this display the name of the person logged in even on the other server/domain????? does this make sense?

hmm... im gonna test it....
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

Advertisement: