Jump to content

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


Adamb10

Recommended Posts

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....

[code]
<?
//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>';


?>
[/code]

Login.php...

[code]<?
//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>
';
?>
[/code]

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

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

actions2.php....
[code]
<?
//actions2.php

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

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

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

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!


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.