netten şöyle bir kod buldum ama kendi kodlarıma ekleyemedim.
örnek login kodları
<?php
// we must never forget to start the session
session_start();
$errorMessage = '';
if (isset($_POST['txtUserId']) && isset($_POST['txtPassword'])) {
// first check if the number submitted is correct
$number = $_POST['txtNumber'];
if (md5($number) == $_SESSION['image_random_value']) {
include 'library/config.php';
include 'library/opendb.php';
$userId = $_POST['txtUserId'];
$password = $_POST['txtPassword'];
// check if the user id and password combination exist
$sql = "SELECT user_id
FROM tbl_auth_user
WHERE user_id = '$userId'
AND user_password = PASSWORD('$password')";
$result = mysql_query($sql) or
die('Query failed. ' . mysql_error());
if (mysql_num_rows($result) == 1) {
// the user id and password match,
// set the session
$_SESSION['image_is_logged_in'] = true;
// remove the random value from session
$_SESSION['image_random_value'] = '';
// after login we move to the main page
header('Location: main.php');
exit;
} else {
$errorMessage = 'Sorry, wrong user id / password';
}
include 'library/closedb.php';
} else {
$errorMessage = 'Sorry, wrong number. Please try again';
}
}
?>bunlar örnek login sayfası
<html>
<head>
</head>
<body>
<?php
if ($errorMessage != '') {
?>
<p align="center"><strong><font color="#990000"><?php echo $errorMessage; ?></font></strong></p>
<?php
}
?>
<form action="" method="post" name="frmLogin" id="frmLogin">
<table width="500" border="1" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="150">User Id</td>
<td><input name="txtUserId" type="text" id="txtUserId" size="20"></td>
</tr>
<tr>
<td width="150">Password</td>
<td><input name="txtPassword" type="password" id="txtPassword" size="20"></td>
</tr>
<tr>
<td width="150">Enter Number</td>
<td><input name="txtNumber" type="text" id="txtNumber" value="" size="20">
<img src="randomImage.php"></td>
</tr>
<tr>
<td width="150"> </td>
<td><input name="btnLogin" type="submit" id="btnLogin" value="Login"></td>
</tr>
</table>---------------------benim login kodları ise aşağıdaki gibi
<?
if(!$url)
{
echo"url boş";
exit;
}
if(!$des){
echo"des boş.";
exit;
}
$sql="insert into $tablo
(id,mail,des,url)
values
('','$mail','$url','$des')";
$sonuc=mysql_query("$sql");
echo "olduuuu<br>";
?>benim login sayfası
<form name="adda" action="submit.php" method="post" >
<table>
<tr>
<td width="28%" height="21"><b><font face="Trebuchet MS">URL</font></b></td>
<td width="72%" height="21">
<input type="text" name="url" size="40" value="http://"></td>
</tr>
<tr>
<td width="28%" height="21"><b><font face="Trebuchet MS">Des</font></b></td>
<td width="72%" height="21">
<!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="100" --><input type="text" name="des" size="40" maxlength="100"></td>
</tr>
<tr>
<td width="28%" height="21"><b><font face="Trebuchet MS">Email:</font></b></td>
<td width="72%" height="21"><input type="text" name="email" size="40"></td>
</tr>
<tr>
<td width="28%" height="1"></td>
<td width="72%" height="1">
<p align="center">
<input type="submit" value="Submit" name="B1" ></td>
</tr>
</table>yardımcı olabilecek arkadaşlara şimdiden teşekkür ederim. sanırım sorunu yeterince açık anlatmışımıdır..