Current location: Hot Scripts Forums » Programming Languages » PHP » Simple db_ help needed


Simple db_ help needed

Reply
  #1 (permalink)  
Old 03-24-06, 05:52 PM
aclips aclips is offline
New Member
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Simple db_ help needed

First of all i want to give my coungrats to all this great community for the work that your building here

I want to creat a simple database to check a username with a password to output an url. This is for a account login script where only the admin can add, edit and delete the users account. Its to use with a login script in PHP like this:
Quote:
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$url = "url";

$user_array = array("user1");
$pass_array = array("pass1");
$user_length = count( $user_array );

for ( $i = 0; $i < $user_length; $i++ )
{
if ( $username == $user_array[$i] && $password == $pass_array[$i] )
{

session_register("user");
session_register("loggedIn");
$_SESSION['user'] = $username;
$_SESSION['loggedIn'] = "true";

header("Location: $url");
}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<p>Rong Password/Username, please make sure that you writed in correctly your Username and Password has provided</p>
<p> If you Lost your password or username please contact site admin</p>
<p> Thanks!! </p>
</body>
</html>

Hope that someone can help me on this, thanks and keep up the good work
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple PHP Search Script needed sohaib PHP 2 01-01-06 12:38 PM
Simple Mod for Game Needed HopesDespair Job Offers & Assistance 0 07-21-05 08:50 PM
SQL db - custom insert and select query app needed ATS16805 ASP.NET 1 06-24-05 04:38 PM
Simple Script NEEDED ASAP - $$$$ legante Script Requests 0 11-01-04 03:18 PM
A simple form to upload fields to an Access Db techknow Script Requests 1 04-19-04 10:11 AM


All times are GMT -5. The time now is 07:05 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.