lol no luck at all ;'[
thanks for trying to help tho, much appreciated
kinda odd how this used to work for me =s
i might have to make my site transitional instead of strict and use an iframe in it =(
<?PHP include("artikelen/loginbox.php"); ?> <?php
///////////////////////////////////////////////////////////////////
//
//Login box by FI-DD
//http://english.cutenews.ru/forum/profile.php?mode=viewprofile&u=2
//Based on:http://www.xs4all.nl/~cvdtak/loginbox_1.0.htm
//
///////////////////////////////////////////////////////////////////
if (!defined('CN_INIT_LOGINBOX')) {
define('CN_INIT_LOGINBOX', true);
$echo = cute_lang();
if(session){
session_start();
}
$username = $_POST['username'];
$password = $_POST['password'];
if($_POST['act'] == 'dologin'){
$is_logged_in = false;
if ($username){
$cmd5_password = md5x($password);
if (check_login($username, $cmd5_password)){
$cookie_logged = true;
if(cookie){
@setcookie('login_username', $username, time() + 3600 * 24 * 365);
}
if(session){
session_register('login_username');
$_SESSION['login_username'] = $username;
}
} else {
$error = '<font color="red">'.$echo['loginError'].'</font>';
$cookie_logged = false;
}
}
if ($cookie_logged){
$is_logged_in = true;
if ($_POST['act'] == 'dologin'){
$sql->update(array(
'table' => 'users',
'where' => array("username = $username"),
'values' => array('last_visit' => (time() + $config_date_adjust * 60))
));
}
header('Location: '.$PHP_SELF);
}
}
if($_GET['act'] == 'logout'){
if(cookie){
setcookie('login_username', '', time() - 3600 * 24 * 365);
}
if(session){
@session_destroy();
@session_unset();
}
header('Location: '.$PHP_SELF);
}
if(cookie){
if(!$_COOKIE['login_username']){
$is_logged_in = false;
}
else{
$is_logged_in = true;
}
}
if(session){
if(!session_is_registered('login_username') || $_SESSION['login_username'] == "") {
$is_logged_in = false;
}
else{
$is_logged_in = true;
}
}
}
else{
if (!$is_logged_in){
//The login box
?>
<form method="post" action="<?=$PHP_SELF; ?>">
<table>
<tr>
<td>Gebruikersnaam: <input type="text" name="username" size="14"></td>
<td><td>Wachtwoord: <input type="password" name="password" size="14"></td>
<td><input type="submit" value="OK"></td>
<tr>
</table>
<input type="hidden" name="act" value="dologin">
</form>
<?
}
else{
echo 'Ingelogd als: <strong>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</strong>
<a href="http://www.mysite.com/cuteru.nl/artikelen/?mod=personal" target="_blank">Profiel wijzigen</a>
<a href="http://www.mysite.com/leden"><span class="new">Leden</span></a>
<a href="http://www.mysite.com/cuteru/?mod=addnews" target="_blank">Nieuws Submit</a>
<a href="http://www.mysite.com/cuteru/index.php?mod=options&action=pm" target="_blank">Inbox ('.count_unread_messages().')</a>
<a href="'.$PHP_SELF.'?act=logout">Log uit</a>';
}
echo $error;
}
?>echo 'Logged in as <b>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</b>. <br /><a href="'.$PHP_SELF.'?act=logout">Log out.</a>';echo 'Logged in as <b>'.($username ? $user_name[$username] : (cookie ? $user_name[$_COOKIE['login_username']] : $user_name[$_SESSION['login_username']])).'</b>. <br /><a href="'.$PHP_SELF.'?act=logout">Log out.</a>';<!------ Login Box------>
<? if (!$is_logged_in){ ?>
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="138" align="center">
<form name="login" action="" method="post" onsubmit="return process_form(this)">
<tr>
<td width="55" style="font-size:14px;"><div align="left">User:</div></td>
<td><input tabindex="1" type="text" name="username" value="<?=$lastusername; ?>" style="width:73px"></td>
</tr>
<tr>
<td style="font-size:14px;"><div align="left">Password:</div></td>
<td><input type="password" name="password" style="width:73px"></td>
</tr>
<tr>
<td></td>
<td><div align="center"><input accesskey="s" type="submit" style="font-size:12px;width:45px;" value="Log In"></div></td>
</tr>
<tr>
<td align="center" colspan="3"><font size="1"><?=$result; ?></td>
</tr>
<input type="hidden" name="action" value="dologin">
</form>
</table></div>
<?
}
elseif ($is_logged_in){
?>
<iframe name="loginbox" src="cms/indexlog.php" width="138" height="100" frameborder="0" marginheight="0" marginwidth="0" align="center">
<font size="2">Your browser does not support I-Frames</font>
</iframe>
<?
}
?>
<!------ ENDLogin Box------>
<?php
$PHP_SELF = 'indexlog.php';
$config_cutenews_version = 'CuteNews.RU';
$config_cutenews_built = '2.5.4';
#-------------------------------------------------------------------------------
include_once 'head.php';
@chmoddir($cutepath.'/data', chmod);
@chmoddir($cutepath.'/cache', chmod);
@chmod($cutepath.'/data', 0755);
$timer = new microTimer;
$timer->start();
if ($action == 'logout'){
setcookie('md5_password', '', time() - 3600 * 24 * 365, '/');
setcookie('username', '', time() - 3600 * 24 * 365, '/');
setcookie('login_referer', '');
@session_destroy();
@session_unset();
@setcookie(session_name(), '');
?>
<!-- Javascript redirect -->
<script type="text/javascript">self.location.href="<?=$_SERVER['PHP_SELF']; ?>";</script>
<?
}
b64dck();
// If User is Not Logged In, Display The Logout Message
if (!$is_logged_in){
if (session){
@session_destroy();
@session_unset();
}
setcookie('username', '', time() - 3600 * 24 * 365, '/');
setcookie('password', '');
setcookie('md5_password', '', time() - 3600 * 24 * 365, '/');
setcookie('login_referer', '');
//echoheader('user', $echo['header']);
?>
<!-- The Logout Message -->
<br>You have logged out successfuly!
<?
//echofooter();
} elseif ($is_logged_in){
if (check_referer){
$self = $_SERVER['SCRIPT_NAME'];
if (!$self){
$self = $_SERVER['REDIRECT_URL'];
}
if (!$self){
$self = $PHP_SELF;
}
if (!eregi($self, $HTTP_REFERER) and $HTTP_REFERER){
echo sprintf($echo['badReferer'], $PHP_SELF);
exit;
}
}
//Logged in Message
echo '<div align="right" dir="rtl"><font size="1px" face="arial"><br><font size="2px">Welcome, <br><b>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</b>. <br /><br><a href="'.$PHP_SELF.'?action=logout">Log Out</a></div>';
}
?>
Goberg wrote:I have a problem with redirecting after logging in.
I have the login box in a file called view-films.php, this is also the file that i am showing the full story articles in. So if anyone is reading an article, say the url to the article is http://www.myurl.com/view-films.php?id=11 . The user could log in from this site but they get redirected to http://www.myurl.com/view-films.php instead of http://www.myurl.com/view-films.php?id=11.
I am using FIDDs original script and it is working good for me, I just want this redirection to work. Any help?
//The login box
?>
<form method="post" action="<?=$PHP_SELF; ?>">
DarkSlim wrote:Find:
- Code: Select all
//The login box
?>
<form method="post" action="<?=$PHP_SELF; ?>">
Now change the: <?=$PHP_SELF; ?>
To: http://www.myurl.com/view-films.php
The page that you want to be transfered to
Return to Additional Downloads
Users browsing this forum: No registered users and 0 guests