Jump to content


Photo

Index.php being printed on pages I dont want it on


  • Please log in to reply
No replies to this topic

#1 Adamb10

Adamb10
  • Members
  • PipPip
  • Member
  • 19 posts
  • LocationMilwaukee, Wisconsin

Posted 29 May 2006 - 01:11 AM

Hey all,

[a href=\"http://adamb10.com/ub2/index.php?action=login\" target=\"_blank\"]http://adamb10.com/ub2/index.php?action=login[/a] See that the guestbook header(the menu on the bottom) is being printed well on the bottom? :P I dont want it there. I only want it on the top.

Time for some code.

Index.php....

<?
//index.php

//Start the session
session_start();


//Load required files
require('sources/functions.php');
require('sources/actions.php');
require('sources/actions2.php');

//Essential Functions
db_connect();

//Prepare for Query in 5..4..3..2..1
function query($query){
    $sql = "$query";
    $result = mysql_query($sql);
    return mysql_fetch_array ($result);  
}

//Query time!
$row = query("SELECT * FROM settings");
$row = query("SELECT * FROM colors");

//Lets output the html
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
<!--
a:link {
    color: #'.$row['link'].';
    text-decoration: none;
}
a:visited {
    color: #'.$row['vistedlink'].';
    text-decoration: none;
}
a:active {
    color: #'.$row['activelink'].';
    text-decoration: none;
}
a:hover {
    color: #'.$row['hoverlink'].';
    text-decoration: underline;
    }
body {
    background-color: #'.$row['bodybg'].';
    font-family: '.$row['fontfamily'].';
    font-size: 11px;
    color: #'.$row['font'].';
    margin:0px;
    }
.titlebg {
    background-color: #'.$row['titlebg'].';
    font-family: '.$row['fontfamily'].';
    font-size: 11px;
    color: #'.$row['titlefont'].';

    }
.windowbg {
    background-color: #'.$row['windowbg'].';
    font-family: '.$row['fontfamily'].';
    font-size: 11px;
    color: #'.$row['font'].';
    }
.windowbg2 {
    background-color: #'.$row['window2bg'].';
    font-family: '.$row['fontfamily'].';
    font-size: 11px;
    color: #'.$row['font'].';
    }
.border {
    background-color: #'.$row['border'].';
    }
td {
    font-size: 11px;
    }
input,textarea {
    font-family: '.$row['fontfamily'].';
    font-size: 11px;
    }
select {
    font-family: '.$row['fontfamily'].';
    font-size: 11px;
    }
    --!>
    </style>
    <title>'.$row['title'].'</title>
</head>

<body>';

//echo out the Guestbook Header
guestbook_header();

echo '
</body>
</html>';


?>

Login.php...

<?
//login.php

//essential functions to life
db_connect();
guestbook_header();

echo '
<br>
<center>
<table class="border" style="width: 25%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="4" cellspacing="1" class="border">


    <tr class="titlebg">

      <td>Login</td>

    </tr>

    <tr class="windowbg2">

     <td>

     Please
login using your details below:<br>
<table style="width: 25%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="4" cellspacing="1">
<tr>
      <br>          <form method="post" action="?action=loggingin" name="Login">Username:&nbsp;<input size="20" name="Username"></tr><tr>
Password:&nbsp; <input size="20" name="Password" type="password"></tr><br><br>
</table>
        <div style="text-align: center;"><input value="Login" type="submit"></div>
        </td>
        
  
        <br>

      </form>

      </td>

    </tr>

</table>
</center>
';
?>

actions.php....
<?
//actions.php
$action = $_GET['action'];

if($action == "login"){
    require('login.php');
}
if($action =="admin"){
    require('admin.php');
}
?>

actions2.php....
<?
//actions2.php

if (isset($_GET['action'])) {

$action = $_GET['action'];
if($action == "login"){
return('actions.php');

}elseif ($action == "processlogin"){
return('actions.php');
}
}
?>

The code in actions2.php is supposed to prevent what is happening right now but it's not now.

Any help is greatly welcomed! [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

Thanks!







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users