Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-15-2006, 11:33 AM
Ace-BH- is offline Ace-BH-
Registered User

Join Date: Feb 2004
Posts: 17

Send a message via AIM to Ace-BH-
reconnet via a CMS

hi! i fixed my CMS, now i just need to know how to reconnet it to the members olny page. any one know how to do this?
header.inc.php
PHP Code:
<?php
/************************************************************************/
/* Stargate SG1 Squad Website                                           */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2005 by Trenton Cayetano (Ace-SG1-)                    */
/*                                                                      */
/* AIM: toofasttokill                                                   */
/* MSN: [email]Keawepoo@msn.com[/email]                                                */
/* Yahoo: toofasttokill                                                 */
/* Xfire: acesg1                                                        */
/* E-mail: [email]SG1@hawaii.rr.com[/email]                                            */
/*                                                                      */
/* [url]http://www.stargatesg1.r8.org[/url]                                        */
/* [url]http://www.honorsquad.com/sg1[/url]                                        */
/*                                                                      */
/* You can not redistribute it and/or modify.                           */
/************************************************************************/
?>
<?php
session_start
();
// set your infomation.
$dbhost='****';
$dbusername='****';
$dbuserpass='****';
$dbname='****';

// connect to the mysql database server.
mysql_connect ($dbhost$dbusername$dbuserpass);

if (!
mysql_select_db($dbname)) die(mysql_error());

$limit_time time() - 300;
$query2 "DELETE FROM peep_online WHERE UNIX_TIMESTAMP(activity) <= $limit_time";
mysql_query($query2) or die(mysql_error());

$query "SELECT COUNT(ip_address) as numrows FROM peep_online WHERE ip_address = '".$_SERVER['REMOTE_ADDR']."'";
$result mysql_query($query);
$row mysql_fetch_array($resultMYSQL_ASSOC);
$numrows $row['numrows'];

if(
$numrows == 0) {
if (!
session_is_registered('s_username')){
$query1 "INSERT INTO peep_online (activity,member,ip_address,refurl,user_agent) VALUES (now(),'n','{$_SERVER['REMOTE_ADDR']}','{$_SERVER['HTTP_REFERER']}','{$_SERVER['HTTP_USER_AGENT']}')";
mysql_query($query1)or die("Failed to insert for an unregistered user");
}else{
$query1 "INSERT INTO peep_online(activity,member,ip_address,refurl,user_agent) VALUES (now(),'y','{$_SERVER['REMOTE_ADDR']}','{$_SERVER['HTTP_REFERER']}','{$_SERVER['HTTP_USER_AGENT']}')";
mysql_query($query1)or die("Failed to insert for a registered user");
}
}

$query "SELECT COUNT(id) AS numrows FROM stats WHERE ip='".$_SERVER["REMOTE_ADDR"]."'";
$result mysql_query($query) or die('Error, query failed');
$row mysql_fetch_array($resultMYSQL_ASSOC);
$numrows $row['numrows'];


if (
$numrows == 0)
{
mysql_query("INSERT INTO stats(ip)VALUES ('".$_SERVER["REMOTE_ADDR"]."')") or die('Error, query 3 failed');
}

$query1 "UPDATE stats SET hits=hits+1 WHERE ip = '".$_SERVER['REMOTE_ADDR']."'";
mysql_query($query1) or die('Error, query 1 failed');
//rest of code below after
?>
<?php 
include("config.php");?>
<?php 
include("ipban.php");?>
<?php 
include("iplog.php");?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?php echo "$sitetitlename - $sitetitlemsg"?></title>
<meta name="robots" content="<?php echo "$siterobots"?>">
<meta name="description" content="<?php echo "$sitedescription"?>">
<meta name="keywords" content="<?php echo "$sitekeywords"?>">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="shortcut icon" href="http://www.honorsquad.com/sg1/favicon.ico"/>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<table align="center" style="border: 1px solid #000000;" width="770" height="100%" bgcolor="#275F81" border="0" cellspacing="10" cellpadding="0">
    <tr>
        <td>
            <table align="center" width="750" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td><img src="banner.jpg" width="750" height="150" /></td>
                </tr>
            </table>
            <table align="center" width="750" style="border-left: 1px solid #000000;border-right: 1px solid #000000" border="0" cellspacing="0" cellpadding="0">
                <tr>
                <td height="25" align="left" width="174" background="header.jpg" style="border-right:1px solid #000000;border-bottom:1px solid #000000;">&nbsp;Navigation&nbsp;</td>
                <td height="25" align="center" width="400" background="header.jpg" style="border-right:1px solid #000000;border-bottom:1px solid #000000;">News</td>
                <td height="25" align="left" width="174" background="header.jpg" style="border-bottom:1px solid #000000;">&nbsp;Polls&nbsp;</td>
                </tr>
                </table>
Login.php
PHP Code:
<?php include ('header.inc.php'); ?>
<?php 
include ('navigation.inc.php'); ?>
<?php 
include ('user.inc.php'); ?>
<?php 
include ('affiliate.inc.php'); ?>
<?php 
include ('stats.inc.php'); ?>
<?php
/************************************************************************/
/* Stargate SG1 Squad Website                                           */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2005 by Trenton Cayetano (Ace-SG1-)                    */
/*                                                                      */
/* AIM: toofasttokill                                                   */
/* MSN: [email]Keawepoo@msn.com[/email]                                                */
/* Yahoo: toofasttokill                                                 */
/* Xfire: acesg1                                                        */
/* E-mail: [email]SG1@hawaii.rr.com[/email]                                            */
/*                                                                      */
/* [url]http://www.stargatesg1.r8.org[/url]                                        */
/* [url]http://www.honorsquad.com/sg1[/url]                                        */
/*                                                                      */
/* You can not redistribute it and/or modify.                           */
/************************************************************************/
?>
<?php
//make this login work
If(function_exists("ini_set")) {
 @
ini_set("output_buffering","On");
}
//start of login
if ($_POST['username']) {
//did they supply a password and username
$username=$_POST['username'];
$password=$_POST['password'];
if (
$password==NULL) {
echo 
"A password was not supplied";
}else{
$query mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error());
$data mysql_fetch_array($query);
if(
$data['password'] != $password) {
echo 
"The supplied login is incorrect";
}else{
$query mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error());
$row mysql_fetch_array($query);
$_SESSION["s_username"] = $row['username'];
//remove "header("header.inc.php");" to make login work
}
}
}
?>
<td width="400" valign="top" align="left">
<table width="400" bgcolor="#2B5C86" border="0" cellspacing="0" cellpadding="0" style="border-left: 1px solid #000000;border-right: 1px solid #000000;border-bottom: 1px solid #000000;">
<tr>
<td align="center"><table width="370" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><h1>Login<br />
</h1>
  </td>
</tr>
<tr>
<form action="login.php" method="POST">
<td>
<table>
<tr>
<td>Username:</td><td align="right"><input type="text" size="15" maxlength="25" name="username"></td>
</tr>
<tr>
<td>Password:</td><td align="right"><input type="password" size="15" maxlength="25" name="password"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Login"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
Waring: if you just loged in refrish or hit &quot;home&quot; to login to the members olny page <a href="forgot.php"><br />
forgot your password or username?</a></td>
</tr>
</table>
</td>
<?php include ('other.inc.php'); ?>
<?php 
include ('footer.inc.php'); ?>
THX!
Reply With Quote
Reply


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

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for a CMS / blog site thing :/ Steve Web design and Programming 15 04-21-2006 03:25 PM
CMS Login Ace-BH- Web design and Programming 3 02-13-2006 08:03 PM


All times are GMT -5. The time now is 08:36 PM.




Powered by vBulletin®