سورس کد فرم ثبت نام و لاگین با php ، پروژه فرم ثبت نام و لاگین با زبان برنامه نویسی php
با معرفی سورس کد فرم ثبت نام و لاگین با php در خدمت شما همراهان سورس سافت هستیم.
سورس کد فرم ثبت نام و لاگین با php
سورس فرم ثبت نام و لاگین با زبان برنامه نویسی php و دیتابیس Mysql طراحی و کدنویسی شده است که میتوانید در پروژه های خود ازش استفاده کنید. همچنین در این پروژه از تکنولوژی PDO نیز استفاده شده است.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login page</title>
<?php require('dbcon.php'); ?>
</head>
<body>
<center>
<form method="post" action="login.php">
<h3>Log In</h3>
<input type="text" name="username" placeholder="Username" required> <br><br>
<input name="password" type="password" placeholder="Password" required > <br><br>
<button type="submit" name="login">Log In</button>
</form>
<br>
<hr>
<form method="post" action="register.php">
<h3>Register</h3>
<input class="long" name="username" required="required" type="text" placeholder="Username" /> <br> <br>
<input name="password" required="required" type="password" placeholder="Password"/> <br><br>
<input name="firstname" required="required" type="text" placeholder="First Name"/> <br><br>
<input name="lastname" required="required" type="text" placeholder="Last Name"/> <br><br>
<button type="submit" name="signup" onclick="signup()">Sign Up</button>
</form>
</center>
</body>
</html>
نمونه کد فرم لاگین پروژه :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login page</title>
<?php include('dbcon.php'); ?>
<?php
session_start();
if (!isset($_SESSION['id'])){
header('location:index.php');
}
$session_id = $_SESSION['id'];
$session_query = $conn->query("select * from user where user_id = '$session_id'");
$user_row = $session_query->fetch();
?>
</head>
<body>
<center><h1> WELCOME! </h1> <h2><a href="#"><?php echo $user_row['firstname']." ".$user_row['lastname']; ?></a></h2>
<br><hr><br>
<a href="logout.php"><button type="submit">Log Out</button></a>
</center>
</body>
</html>
جهت استفاده از پروژه باید اطلاعات دیتابیس خود را در فایل dbcon جایگزین کنید.
نکته: نسخه php استفاده شده پروژه 5.3.8 می باشد.
امیدواریم این سورس کد رایگان مورد استفاده شما دوستان قرار بگیرد.