üye giriş yönlendirme.

okinoksOkan TAMUSTA

Kolay gelsin arkadaşlar,

üye giriş sayfası yaptım üye giriş yapabiliyor ve giriş sayfasına istediğim yetki ile gidiyor. fakat benim istediğim üye giriş yaptıktan sonra her üye kendi sayfasına gitsin.

örneğin

ahmet ==> ahmet.php

mehmet==> mehmet.php

benim sayfamda hepsi giris.php ye gidiyor

yardımcı olursanız sevinirim.

2014-01-22 17:13:09

Php

TeaMTurkeRŞenol TÜRKER

her üyeyi ismi ile bir php sayfasına yönlendirmeniz biraz mantıksız anladığım kadarıyla her üyenin kendi profiline yönlendirilmesini istiyorsunuz.

bunun için üye girişi yaptıktan sonra üye idsi ile kullanıcıyı profil.php sayfasına yönlenrireceksiniz ve getden gelen id ile profil.php de uyenin bilgilerini çekip ekrana basacaksınız.

2014-01-22 22:51:19

Php

unal27unal kurtgoz

giris.php giden uyelerini id lerine gore yetkilendirmen dha mantıklı her uyeye sayfa oluşturmak mantıksız sayfanın örnek demosunu gostersen sana yardımcı olurum bu konuda ne yapmak istedigini ne yetki verecegini detaylı belirtirsen daha pratik olur

2014-01-23 11:16:33 Edit:2014-01-23 11:17:58

kodlama

okinoksOkan TAMUSTA

kodlamayı yazdım bir bakarsanız sevinirim

2014-01-23 15:47:43

Php

okinoksOkan TAMUSTA

Öncelikle şunu belirteyim ben dw ve php ye yeni başladım;sadece dw üzerinden bir şeyler yapa biliyorum. 

Yaptığım giriş sayfasında sadece kullanıcı adı ve şifre ile giriş yaptırıp yetkisini kontrol ettire biliyorum. Benim istediğim daireno ve durumuna göre sayfaya girsin ve kendi sayfasına gitsin herkes, yani daire iki ev sahibi kendi sayfasına daire 2 kiracı kendi sayfasına gibi
kodlaması dw de aşağıdaki gibi oluyor. daire ve durum bilgisi aldıramıyorum.
ve herkes giris.php ye gidiyor.

<?php require_once('Connections/site.php'); ?>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 

{

  if (PHP_VERSION < 6) {

    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;    

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}

?>

<?php

// *** Validate request to login to this site.

if (!isset($_SESSION)) {

  session_start();

}

$loginFormAction = $_SERVER['PHP_SELF'];

if (isset($_GET['accesscheck'])) {

  $_SESSION['PrevUrl'] = $_GET['accesscheck'];

}

if (isset($_POST['kullaniciadi'])) {

  $loginUsername=$_POST['kullaniciadi'];

  $password=$_POST['daireno'];

  $MM_fldUserAuthorization = "yetki";

  $MM_redirectLoginSuccess = "giris.php";

  $MM_redirectLoginFailed = "hata.php";

  $MM_redirecttoReferrer = true;

  mysql_select_db($database_site, $site);

 

  $LoginRS__query=sprintf("SELECT kullaniciadi, sifresi, yetki FROM uyeler WHERE kullaniciadi=%s AND sifresi=%s",

  GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 

  $LoginRS = mysql_query($LoginRS__query, $site) or die(mysql_error());

  $loginFoundUser = mysql_num_rows($LoginRS);

  if ($loginFoundUser) {

    $loginStrGroup  = mysql_result($LoginRS,0,'yetki');

if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}

    //declare two session variables and assign them

    $_SESSION['MM_Username'] = $loginUsername;

    $_SESSION['MM_UserGroup'] = $loginStrGroup;      

    if (isset($_SESSION['PrevUrl']) && true) {

      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];

    }

    header("Location: " . $MM_redirectLoginSuccess );

  }

  else {

    header("Location: ". $MM_redirectLoginFailed );

  }

}

?>

<form name="form1" method="POST" action="<?php echo $loginFormAction; ?>">

  <table border="0" align="center">

    <tr>

      <td>Kullanıcı Adı</td>

      <td>:</td>

      <td><label for="kullaniciadi"></label>

      <input type="text" name="kullaniciadi" id="kullaniciadi"></td>

      <td>Daire No</td>

      <td>:</td>

      <td><label for="daireno"></label>

        <select name="daireno" id="daireno">

          <option>Daire 1</option>

          <option>Daire 2</option>

      </select></td>

    </tr>

    <tr>

      <td>Şifresi</td>

      <td>:</td>

      <td><label for="sifresi"></label>

      <input type="text" name="sifresi" id="sifresi"></td>

      <td>Durumu</td>

      <td>:</td>

      <td><label for="durumu"></label>

        <select name="durumu" id="durumu">

          <option>Kiracı</option>

          <option>Ev sahibi</option>

      </select></td>

    </tr>

    <tr>

      <td>&nbsp;</td>

      <td>&nbsp;</td>

      <td><input type="submit" name="button" id="button" value="Gönder"></td>

      <td>&nbsp;</td>

      <td>&nbsp;</td>

      <td>&nbsp;</td>

    </tr>

  </table>

</form>

2014-01-23 15:46:48

Edit:

phpkodlari.com © 2009 Herkes Php öğrenecek
Eglence ve Oyun: Gamikro