Jump to content
php.lv forumi

Sesijas un cepumi.


Chupakabra
 Share

Recommended Posts

Sveiki visiem.

Kads nevaretu palidzet ar to ka pareizi japieraksta login faila sesijas un cepumi ta lai tie abi stradatu kopa?

 

Pats kods sobrid ir :

 

<?php
require_once('scripts/mysqlconnector.php');
$user = $_GET['user'];
$pass = $_GET['pass'];
 
 
$result=mysql_query("SELECT * FROM account WHERE user = '$user' AND pass = '$pass'");
if(mysql_num_rows($result) == 0){
$login = "&err=Login Failed.";
echo($login);
} else {
$row = mysql_fetch_array($result);
$user=$row['user'];
$pass=$row['pass'];
$login = "&user=" . $user . "&pass=" . $pass . "&err=Login Successful.";
echo($login);
}
?>
Edited by Chupakabra
Link to comment
Share on other sites

Zini kāpēc sensenos laikos aizliedza buršanos? Tāpēc, ka bija "burvji", kas zināja buramvārdus, bet nezināja īsti to nozīmi un kā tas strādā (patiesībā viņiem nebija ne mazākās sajēgas par to) un bieži sanāca daudz ziepes. Skaties, ka, dēļ tādiem kā tu, neaizliedz programmēšanu.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...