I need this script to connect to the database etc which all works perfectly then check if the user is logged in via cookie check... if they aren't i need to to redirect to re_login.php and if they are then display the page that includes this script...
Can it be done and am i on the right lines??
Code so far for auth.php
PHP Code:
<?php $userid = $HTTP_COOKIE_VARS['bbuserid']; $password = $HTTP_COOKIE_VARS['bbpassword']; $vbhost = "localhost"; $vbuser = "user"; $vbpass = "pass"; $vbname = "name"; $vb=mysql_connect("$vbhost","$vbuser","$vbpass"); mysql_select_db($vbname,$vb) or die ("Forum Database Connectivity Error"); $vbsql=mysql_query("select * from user where userid = '$userid'"); $vbinfo=@mysql_fetch_array($vbsql); $username=$vbinfo[username]; if (!$username) {}{ header('location: re_login.php'); } elseif ($username) { ?>
|