Hi all,
thank you for reading this
Will, my problem is that i have a page in my site and i want only my vBulletin forum users , not the guests ( this mean if go to this page you have login your username and password of the forum in order to see the this page )
So ( how can integrate my login script with the forum database )
this is my login script that i have downloaded .
1) the config file config.php:
<?php
//READ 'README.TXT' FIRST
//config file
ob_start();
session_start();
//mysql info
$host = "localhost"; //mysql host
$user_name = ""; //mysql username
$password = ""; //mysql password
$database_name = ""; //mysql database name
$_login_file = "login.php"; //login page
$redirect_url = "main.php"; //main page;where it is redirected after login
?>
2) the login.php
<?php
include("config.php");
echo "<br>";
echo "<form method='post' action='?do=check'><table>";
echo "<tr><td>username:</td><td><input type='text' name='username'></td></tr>";
echo "<tr><td>password:</td><td><input type='password' name='password'></td></tr>";
echo "<tr><td></td><td><input type='submit' value='submit'></td></tr>";
echo "</table></form><br>";
if($_GET['do'] == 'check')
{
$_user_name = $_POST['username'];
$_password = $_POST['password'];
//check the login
mysql_connect($host, $user_name, $password)
or die('Could not connect: ' . mysql_error());
//select database
mysql_select_db($database_name) or die('Could not select database');
$result = mysql_query("SELECT * FROM users WHERE username='$_user_name'") or die(mysql_error());
$row = mysql_fetch_array( $result );
if($row['username'] == '')
{
echo "<b>username or password is incorrect</b><br>";
}
else
{
if($row['password'] == $_password)
{
$_SESSION['logged'] = "agk8gjf38834j2";
$_SESSION['user'] = $_user_name;
header("location:" . $redirect_url);
}
else
{
echo "<b>username or password is incorrect</b><br>";
}
}
}
?>
3) the Restricted page main.php
<?php
include("config.php");
if($_SESSION['logged'] != 'agk8gjf38834j2')
{
header("location:" . $_login_file);
}
echo "This is the temporary main page";
?>
can anyone integrate it with vBulletin 3.6
please help me it is important
regards