Autor Zpráva
manzes
Profil
Dobrý den, hledal jsem na hodně stránkách jak chybu vyřešit ale nic jsem nenašel. Chybu mi to hlásí ve zvýrazněné sekci.
1<?php 
2session_start();
3if(!sset($_SESSION["manager"])){
4   header("location:   admin_login.php");
5   exit();
6}
7//Be sure to check that this ,manager SESSION value is in fact the database
8$managerID = preg_replace('#[^0-9]#i',",$_SESSION["id"]);//filter everything but numbera and letters
9$manager = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["manager"]);//filter everything but numbera and letters 
10$password = preg_replace('#[^A_Za-z0-9]#i',",$_SESSION["password"]);//filter everything but numbera and letters

11 
12 
13include "../storescripts/connect_to_mysql.php";
14$sql = mysql_query("select*From admin WHERE id='$managerID' AND username='$manager' AND password='$password' LIMIT 1");
15 
16$existCount = mysql_num_rows($sql); 
17if ($existCount == 0){ 
18    header("location: ../index.php");
19    exit();
20}
<?php 
session_start();
if(!sset($_SESSION["manager"])){
   header("location:   admin_login.php");
   exit();
}
//Be sure to check that this ,manager SESSION value is in fact the database
$managerID preg_replace('#[^0-9]#i',",$_SESSION["id"]);//filter everything but numbera and letters
$manager = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["manager"]);//filter everything but numbera and letters 
$password preg_replace('#[^A_Za-z0-9]#i',",$_SESSION["password"]);//filter everything but numbera and letters
 
 
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");
    exit();
}

Prosím poradíte mi?
Davex
Profil
Chyba je v té jedné uvozovce, která je sama o sobě chybná. Asi by tam měly být dvě uvozovky.

$managerID = preg_replace('#[^0-9]#i',"",$_SESSION["id"]);//filter everything but numbera and letters
$manager = preg_replace('#[^A-Za-z0-9]#i',"",$_SESSION["manager"]);//filter everything but numbera and letters 
$password = preg_replace('#[^A_Za-z0-9]#i',"",$_SESSION["password"]);
$managerID preg_replace('#[^0-9]#i',"",$_SESSION["id"]);//filter everything but numbera and letters
$manager preg_replace('#[^A-Za-z0-9]#i',"",$_SESSION["manager"]);//filter everything but numbera and letters 
$password preg_replace('#[^A_Za-z0-9]#i',"",$_SESSION["password"]);
peta
Profil
manzes:
Zkus pouzit obarvovani kodu, treba v pspadu.
!sset - jestli to nemelo byt isset
Vypada to na nejaky naskenovany kod z knizky, nekdo byl linej opisovat.
Toto vlákno je staré, již dlouho do něj nikdo nepřispíval.

Informace a odkazy zde uváděné už nemusejí být aktuální. Nechcete-li řešit zde uvedenou konkrétní otázku, založte si vlastní vlákno, nepište do tohoto. Vložíte-li sem nyní příspěvek, upoutáte pozornost mnoha lidí a někteří z nich si jen kvůli vám přečtou i všechny předcházející příspěvky. Předpokládáte-li, že váš text skutečně bude hodnotný, stiskněte následující tlačítko:


Běda vám, jestli to bude blábol.

0