Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Redirect po login

Parašė Xinel· 2012 Gru. 15 10:12:31
#1

Sveiki, savo puslapyje turiu padaręs, kad nerodytų setuser ir gal galėtų kas pasakyti kaip padaryti, kad prisijungus redirectintų į tam tikrą puslapį?

setuser.php

<?php
/*---------------------------------------------------+
| <span style="border-bottom: 1px dotted black;">PHP</span>-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| <a href='http://www.php-fusion.co.uk/' target='_blank'><span style='color:005C5B'>http://www.php-fusion.co.uk/</span></a>
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit <a href='http://gnu.org' target='_blank'><span style='color:005C5B'>http://gnu.org</span></a>
+----------------------------------------------------*/
require_once "maincore.php";
include THEME."theme.php";
 
echo "<!DOCTYPE <span style="border-bottom: 1px dotted black;">HTML</span> PUBLIC '-//W3C//DTD <span style="border-bottom: 1px dotted black;">HTML</span> 4.01 Transitional//EN'>
<html>
<head>
<title>".$settings['sitename']."</title>
<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."'>
<meta http-equiv='refresh' content='2; url=index.php'>
<link rel='stylesheet' href='".THEME."styles.css' type='text/css'>
</head>
<body class='tbl2'>
 
<table width='100%' height='100%'>
<tr>
<td>";
 
 
if (isset($_REQUEST['logout']) && $_REQUEST['logout'] == "yes") {
   header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'");
   setcookie("fusion_user", "", time() - 7200, "/", "", "0");
   setcookie("fusion_lastvisit", "", time() - 7200, "/", "", "0");
   redirect(BASEDIR."index.php");
} else {
   if (!isset($error)) $error = "";
   if ($error == 1) {
      echo"<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl1'>
<center><br>
<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."'><br><br>\n";
      echo "<b>".$locale['194']."</b><br><br>\n";
   } elseif ($error == 2) {
      echo"<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl1'>
<center><br>
<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."'><br><br>\n";
      echo "<b>".$locale['195']."</b><br><br>\n";
   } elseif ($error == 3) {
      echo"<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl1'>
<center><br>
<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."'><br><br>\n";
      echo "<b>".$locale['196']."</b><br><br>\n";
   } else {
      if (isset($_COOKIE['fusion_user'])) {
 
      echo"<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl1'>
<center><br>
<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."'><br><br>\n";
         $cookie_vars = explode(".", $_COOKIE['fusion_user']);
         $user_pass = (preg_match("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : "");
         $user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($user));
         if (!dbcount("(user_id)", "users", "user_name='".$user_name."' AND user_password='".md5($user_pass)."'")) {
            echo "<b>".$locale['196']."</b><br><br>\n";
         } else {
            $result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'");
            echo "<b>".$locale['193'].$user."</b><br><br>\n";
         }
      }
   }
}
 
echo $locale['197']."<br><br>
</center>
</td>
</tr>
</table>
 
</td>
</tr>
</table>
 
</body>
</html>\n";
 
ob_end_flush();
?>


Šito pakeitimas nieko nepadėjo

<meta http-equiv='refresh' content='2; url=index.php'>

Parašė KiraLT· 2012 Gru. 15 19:12:42
#2

Yra juk php f funkcija redirect('index.php');

Parašė Wasiulis· 2012 Gru. 16 01:12:45
#3


<meta http-equiv='refresh' content='2; url=index.php'>

Parašė mNm.· 2012 Gru. 16 10:12:26
#4

sako kad nepadeda

Parašė Xinel· 2012 Gru. 21 13:12:50
#5

Arba aš kvailas, arba tu. Gi rašiau, kad šitas niekuo nepadėjo. Kitam puslapyje, kur nėra panaikintas setuser rodymas, ten suveikė, čia ne.

Toliau laukiu protingų atsakymų.

Parašė avice· 2012 Gru. 21 14:12:44
#6

Arba jūs visi kvaili , kad nebesugebat tokiu paprastu dalyku pasidaryt:

 
setuser.php
<?php
require_once "maincore.php";
if (iMEMBER && (isset($_REQUEST['logout']) && $_REQUEST['logout'] == "yes")) {
header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'");
setcookie(COOKIE_PREFIX."user", "", time() - 7200, "/", "", "0");
setcookie(COOKIE_PREFIX."lastvisit", "", time() - 7200, "/", "", "0");
session_destroy();
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_ip='".USER_IP."'");
header ('Location: NUORODA KAI ATSIJUNGI');
		exit;
}else{
if (isset($_GET['error'])) {
header ('Location: NUORODA KAI DUOMENYS BUNA KLAIDINGI/BANAS/IR PANASIAI');
}else{
header ('Location: NUORODA KAI SEKMINGAI PRISIJUNGIA');
}
}
?>