Customizing SMF > SMF Coding Discussion
SSI wrong redirect after login
gfr1991:
Hey all,
I've some troubles in implement the login feature on my site. I've this code:
--- Code: --- <?php
require("D:\\inetpub\\webs\\accentosulladcom\\public\\simple\\SSI.php");
if ($context['user']['is_guest'])
{echo <<<EOD
<nav1>
<ul>
<li id="login">
<a id="login-trigger" href="#">
Log in <span>&#x25BC;</span>
</a>
<div id="login-content">
<form action="http://www.accentosullad.com/public/simple/index.php?action=login2" method="post" accept-charset="ISO-8859-1">
<fieldset id="inputs">
<input id="user" type="text" name="user" placeholder="Username" required>
<input id="passwrd" type="password" name="passwrd" placeholder="Password" required>
</fieldset>
<fieldset id="actions">
<input type="submit" id="submit" value="Accedi">
<label><input type="checkbox" name="cookielength" value="-1" checked="checked">Rimani collegato</label>
</fieldset>
</form>
</div>
</li>
<li id="signup">
<a href="">Registrati</a>
</li>
</ul>
</nav1>
EOD;
}
else
{
//You can show other stuff here. Like ssi_welcome(). That will show a welcome message like.
//Hey, username, you have 552 messages, 0 are new.
echo '<nav1>', '<ul>', '<li id="login">', '<a id="login-trigger">', " Ciao ", $context['user']['name'] , '</a>', '</li>', '<li id="signup">', ssi_logout(), '</li>', '</ul>', '</nav1>';
}
$_SESSION['login_url']='http://accentosullad.com'.$_SERVER['PHP_SELF'];
$_SESSION['logout_url']='http://accentosullad.com'.$_SERVER['PHP_SELF'];
?>
--- End code ---
.
Need to use a customed login box, not the ssi_login(). So when I attempt to login on my site, it drives my on my forum index instead of the page i've logged in.
Any tip? Hope you can help me.
gfr1991:
Nobody?
Ricky.:
--- Code: ---$_SESSION['login_url']='http://accentosullad.com'.$_SERVER['PHP_SELF']
--- End code ---
Don't you should add a "/" after your website name . Also, why you need double ie. "\\" in your
--- Code: ---require("D:\\inetpub\\webs\\accentosulladcom\\public\\simple\\SSI.php");
--- End code ---
Is it not working if its :
--- Code: ---require("D:\inetpub\webs\accentosulladcom\public\simple\SSI.php");
--- End code ---
gfr1991:
I insert double "\\" cause I've copied that url from my ssi_example.
However it doesn't work. When I try to login on my site it redirect me on the forum. On the forum I'm logged, but if I go back to my site and refresh the page it show me I'm a guest.
The only way to make it works is to login in the site, then logout from the forum and then re-login on my site. In this case the code works and login redirect me on the page I want.
Any ideas?
raphoto:
I have noticed the same problem.
I have followed all of the recommendations and nothing has worked, the first login fails.
Subsequent logins work fine after one logout from the forum.
As soon as the cache is cleared the problem returns.
jre
Navigation
[0] Message Index
[#] Next page
Go to full version