Login Script
Started on the old forum in March 2009 · view the original in the archive · old links redirect here
Do you want PHP: Sessions or just plan user and pass in the headers ??
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
QUOTE (subzero @ Mar 9 2009, 02:42 PM) <{POST_SNAPBACK}>
Do you want PHP: Sessions or just plan user and pass in the headers ??
need it in php bro..no probs along with sql
// these files should be put in a directory named 'inc'
inc/auth.php // the meat and potatoes of this subject
inc/connect.php // an excellent connection script
inc/nav.php // navigation include for site
// these files should be on the web root
index.php // main page of site
link_1.php // page of site
link_2.php // page of site
link_3.php // page of site
logout.php // destroy session and re-direct to login
Here is the SQL Schema for the table I Query:
CREATE TABLE users (
user_id int(10) unsigned NOT NULL auto_increment,
username varchar(20) NOT NULL default '',
password varchar(20) NOT NULL default '',
PRIMARY KEY (user_id)
) TYPE=MyISAM;
if you copy and paste these files into your favorite text editor, edit the connect.php with your mysql settings, it should work on your server if sessions are supported.
inc/auth.php
<?
// start session
session_start();
// convert username and password from _POST or _SESSION
if($_POST){
$_SESSION['username']=$_POST["username"];
$_SESSION['password']=$_POST["password"];
}
// query for a user/pass match
$result=mysql_query("select * from users
where username='" . $_SESSION['username'] . "' and password='" . $_SESSION['password'] . "'");
// retrieve number of rows resulted
$num=mysql_num_rows($result);
// print login form and exit if failed.
if($num < 1){
echo "You are not authenticated. Please login.
<form method=POST action=index.php>
username: <input type=text name=\"username\">
password: <input type=password name=\"password\">
<input type=submit>
</form>";
exit;
}
?>
inc/connect.php
<?
// replace with your db info
$hostname="localhost";
$mysql_login="myusername";
$mysql_password="mypass";
$database="test";
if (!($db = mysql_connect($hostname, $mysql_login , $mysql_password))){
die("Can't connect to mysql.");
}else{
if (!(mysql_select_db("$database",$db))) {
die("Can't connect to db.");
}
}
?>
logout.php
<?php
// you must start session before destroying it
session_start();
session_destroy();
echo "You have been successfully logged out.
You will now be returned to the login page.
<META HTTP-EQUIV=\"refresh\" content=\"2; URL=index.php\"> ";
?>
nav.php
[url="index.php>Home</a>"]link_1[/url] |
[url="link_2.php>link_2</a>"]link_3[/url] |
<a href=logout.php>logout</a>
index.php
<?
// connect to database
include("inc/connect.php");
// include auth and nav
include("inc/auth.php");
// begin content
include("inc/nav.php");
echo "This is my home page.";
// close mysql connection
mysql_close();
?>
link_1.php
<?
// connect to database
include("inc/connect.php");
// include auth and nav
include("inc/auth.php");
// begin content
include("inc/nav.php");
echo "This is my Link 1.";
// close mysql connection
mysql_close();
?>
link_2.php
<?
// connect to database
include("inc/connect.php");
// include auth and nav
include("inc/auth.php");
// begin content
include("inc/nav.php");
echo "This is my Link 2.";
// close mysql connection
mysql_close();
?>
link_3.php
<?
// connect to database
include("inc/connect.php");
// include auth and nav
include("inc/auth.php");
// begin content
include("inc/nav.php");
echo "This is my Link 3.";
// close mysql connection
mysql_close();
?>
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
please if possible could you add a register to this script????????????????????????? please and maybe an admin panel that can automatically create users either of them is acceptable
They are Only Two types Of people In This World We Have The Binary And The Non-Binary.........
I am the Dark-Lord Saying Hello To all the Dark-Kings of the Universe Visit my site where all the Kings Meet : Dark Region
You can edit most reg script mate 😉 not hard thou
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
please i am awaiting your response
They are Only Two types Of people In This World We Have The Binary And The Non-Binary.........
I am the Dark-Lord Saying Hello To all the Dark-Kings of the Universe Visit my site where all the Kings Meet : Dark Region
im not making a admin page ok
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
ok thanks i really appreciate
They are Only Two types Of people In This World We Have The Binary And The Non-Binary.........
I am the Dark-Lord Saying Hello To all the Dark-Kings of the Universe Visit my site where all the Kings Meet : Dark Region
but there sign up and login there it is easy to see how it works
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
ok, you are a GURU @ subzero
They are Only Two types Of people In This World We Have The Binary And The Non-Binary.........
I am the Dark-Lord Saying Hello To all the Dark-Kings of the Universe Visit my site where all the Kings Meet : Dark Region
but please if possible all i need is a an admin panel that can view users account and create users!!!! just simple
: Welcome Admin to your portal
Create New Account View Active Account Delete Account Logout
Please
subzero help me
They are Only Two types Of people In This World We Have The Binary And The Non-Binary.........
I am the Dark-Lord Saying Hello To all the Dark-Kings of the Universe Visit my site where all the Kings Meet : Dark Region
i will make it simple not all done coding ok.
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
ok thanks
They are Only Two types Of people In This World We Have The Binary And The Non-Binary.........
I am the Dark-Lord Saying Hello To all the Dark-Kings of the Universe Visit my site where all the Kings Meet : Dark Region
i am waiting you @ subzero
They are Only Two types Of people In This World We Have The Binary And The Non-Binary.........
I am the Dark-Lord Saying Hello To all the Dark-Kings of the Universe Visit my site where all the Kings Meet : Dark Region
subzero wrote: im not making a admin page ok
any one change user login with user name (not in mail id)..also with out email confirmation..
plese help me mr subzero..edit and upload new pack..pls
i will make a other one 😉
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…