Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP Help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Khalil" data-source="post: 170396" data-attributes="member: 9938"><p>For the stay logged in untill the session is destroyed, you need to look up for a way to use cookies to guard the session!</p><p> </p><p>and secondly the html redirect is:</p><p>[HTML]<meta HTTP-EQUIV="Refresh" content="0;URL=blank.php"> [/HTML]</p><p> </p><p>----------------</p><p> </p><p>You also need to remake the login file.</p><p>here you go a quick login.</p><p>[PHP]<?php</p><p>if(isset($_POST['submit'])) {</p><p>$_SESSION['username'] = $_POST['username'];</p><p>$_SESSION['password'] = $_POST['password'];</p><p>if(!empty($_SESSION['username']) && !empty($_SESSION['password'])) {</p><p>if(mysql_num_rows(mysql_query("SELECT * FROM `your users table name` WHERE username = '".$_SESSION['username']."' AND password = '".md5($_SESSION['password'])."'")) > 0) {</p><p>echo "you have successfully logged in!";</p><p>} else {</p><p>echo "your username or password is wrong!";</p><p>}</p><p>} else {</p><p>echo "please, fill in all the fields!";</p><p>}</p><p>}</p><p>?>[/PHP]</p><p> </p><p>P.S: remove the md5 tag if your password on the users table is not md5 encrypted.</p></blockquote><p></p>
[QUOTE="Khalil, post: 170396, member: 9938"] For the stay logged in untill the session is destroyed, you need to look up for a way to use cookies to guard the session! and secondly the html redirect is: [HTML]<meta HTTP-EQUIV="Refresh" content="0;URL=blank.php"> [/HTML] ---------------- You also need to remake the login file. here you go a quick login. [PHP]<?php if(isset($_POST['submit'])) { $_SESSION['username'] = $_POST['username']; $_SESSION['password'] = $_POST['password']; if(!empty($_SESSION['username']) && !empty($_SESSION['password'])) { if(mysql_num_rows(mysql_query("SELECT * FROM `your users table name` WHERE username = '".$_SESSION['username']."' AND password = '".md5($_SESSION['password'])."'")) > 0) { echo "you have successfully logged in!"; } else { echo "your username or password is wrong!"; } } else { echo "please, fill in all the fields!"; } } ?>[/PHP] P.S: remove the md5 tag if your password on the users table is not md5 encrypted. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP Help
Top