Şimdi Ara

ecommerce website php baslangic

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
5
Cevap
0
Favori
516
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Merhaba arkadaslar ben yeni php baslangictayim ve yardim istedigim konu ise buradaki hata bir turlu log in olamiyorum . Yardiminiz icin tesekkurler simdiden .yanlis nedir cozemiyorum sadece admin login e gelince tekrardan ana sayfa gibi gosteriyor. hic bir farki olmuyor onceden cok tesekkurler

    admin login
    <?php
    session_start();
    if(!isset($_SESSION["manager"])){
    header("location:index.php");
    exit();
    }
    ?>
    <?php
    //be sure the check that this manager SESSION value is in fact in the database
    if(isset($_POST["username"])&& isset($_POST["password"])){

    $manager = preg_replace('#[^A-Za-z0-9]#i','',$_POST["username"]);
    $password = preg_replace('#[^A-Za-z0-9]#i','',$_POST["password"]);



    include "../storescripts/connect_to_mysql.php";
    $sql = mysql_query("SELECT id FROM admin WHERE username ='$manager' AND password = '$password' LIMIT 1");
    $existCount = mysql_num_rows($sql);
    if($existCount==1) {
    while($row = mysql_fetch_array($sql)){
    $id = $row["id"];

    }
    $_SESSION["id"] = $id;
    $_SESSION["manager"] = $manager;
    $_SESSION["password"] = $password;
    header("location:index.php");
    exit();
    }else{
    echo 'That informaton is incorrect,try again <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=59141190&url=index.php" data-href="index.php">Click Here</a>';
    exit();
    }
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Admin Log In</title>
    <link rel="stylesheet"href="../style/style.css" type="text/css" media="screen"/>
    </head>

    <body>

    <div align="center" id="mainWrapper">
    <?php include_once("../template_header.php")?>
    <div id="pageContent">
    <div align="left"style="margin-left:24 px;">
    <h2> Please Log In To Manage the Store</h2>
    <form id = "form1" name= "form1" method = "post" action="admin_login.php">
    User Name <br />
    <input name = "username" type = "text" id = "username" size = "40"/>
    <br/><br/>
    Password:<br/>
    <input name ="password" type = "password" id = "password" size = "40" />
    <br/>
    <br/>
    <br/>
    <label>
    <input type ="submit" name = "button" id = "button" value="Log In"/>
    </label>
    </form>

    <p> </p>
    </div>
    <br/>
    <br/>
    <br/>
    </div>
    )
    <?php include_once("../template_footer.php");?>
    </div>
    </body>
    </html>



    index.php






    <?php
    session_start();
    if(!isset($_SESSION["manager"])){
    header("location:admin_login.php");
    exit();
    }
    //be sure the check that this manager SESSION value is in fact in the database
    $managerID = preg_replace('#[^0-9]#i','', $_SESSION["id"]);
    $manager = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["manager"]);
    $password = preg_replace('#(^A-Za-z0-9]#i','', $_SESSION["password"]);




    include "../storescripts/connect_to_mysql.php";
    $sql = mysql_query("SELECT*FROM admin WHERE id = '$managerID' AND username ='$manager' AND password='$password' LIMIT 1");
    $existCount = mysql_num_rows($sql);
    if($existCount==0) {
    header("location:../index.php");
    echo "Your login session data is not on record in the database",
    exit();
    }




    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Store Admin Page</title>
    <link rel="stylesheet"href="../style/style.css" type="text/css" media="screen"/>
    </head>

    <body>

    <div align="center" id="mainWrapper">
    <?php include_once("../template_header.php")?>
    <div id="pageContent">
    <div align="left"style="margin-left:24 px;">
    <h2> Hello Store Manager What would you like to do today?</h2>
    <p><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=59141190&url=inventory_list.php" data-href="inventory_list.php">Manage Inventory</a></p>
    <p><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=59141190&url=#" data-href="#">Manage Blah Blah</a></p>
    </div>
    <br/>
    <br/>
    <br/>
    </div>


    Copyright
    </div>


    </body>
    </html>







  • yardiminizi bekliyorum kafayi yemek uzereyim
  • arkadaslar yok mu bir yardim edecek biri?
  • hic kimsenin bilgisi yok mu yahu
  • hic kimsenin bilgisi yok mu yahu
  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.