PHP Login Access Related issues

Source: Internet
Author: User
PHP Login Access Issues
Make a simple page entry


Login yes, but I think a user can manage only one village data now log in to the address bar? id= I can just change it. Login ...
For example, a person logged in with 1 account can only manage 1 of the data but in the address bar to change 1 to 2 he can manage 2 of the data how to limit • My rookie says it hurts to kneel and beg big hands online

Login interface $conn =mysql_connect ("localhost", "xypi20", "a16812343");
mysql_select_db ("JS");
mysql_query ("Set names ' gb2312 '");

if (Isset ($_post["user")) {
$user =$_post["User"];
$password =$_post["Password"];
$sql = "SELECT * from login where user= ' {$user} ' and password= ' {$password} '";
$query =mysql_query ($sql);
$array =mysql_fetch_array ($query);



if ($user = = $array {' user '} and $password = = $array {' Password '}} {

$kind = $array {' Kind '};

Session_Start ();


$_session[' keyword ']= "$kind";

echo ""; }

Else
echo "";
}



?>

Management interface
$conn =mysql_connect ("localhost", "xypi20", "a16812343");
mysql_select_db ("JS");
mysql_query ("Set names ' gb2312 '");
$kind = $_get[' id '];
/*session_start ();
if (!isset ($_session[' keyword '))


echo ""; */
Echo $kind;
Session_Start ();

if (isset ($_session[' keyword '))! = $kind)

echo "";


?>

if (Isset ($_post["name"],$_post["Time"])) {

$name =$_post["name"];
$time =$_post["Time"];
Echo $name;
Echo $time;
Echo $kind;
$sql = "SELECT * from data where kind= ' $kind '";
if ($name)//name is not empty
{
$sql. = "and name = ' $name '";
if ($time)
$sql. = "and input time = ' $time '";

}
ElseIf ($time)
{
$sql. = "and input time = ' $time '";

}


The problem is in this query I am directly where kind= ' $kind ' so no matter what account login in the kind to modify the Address bar can query other data ...

------Solution--------------------
$fuck
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.