Computing.Net > Forums > Web Development > CSS Question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

CSS Question

Reply to Message Icon

Name: eli_hoehandle
Date: May 28, 2004 at 18:15:47 Pacific
OS: Win XP Pro
CPU/Ram: AMD2000/512 PC2100
Comment:

I am a newb. I have a site written using PHP and CSS. I was to add some text and images into a header that will show up on all pages. Can this be done by altering the CSS? If so, where can I find some examples.



Sponsored Link
Ads by Google

Response Number 1
Name: jam14online
Date: May 29, 2004 at 04:47:32 Pacific
Reply:

So, you want to add a header to all pages. This should be done with PHP. You simply add:

<?php include("header.php"); ?>

And change header.php to read whatever page has the header you want included on every page.



0

Response Number 2
Name: FBI Agent
Date: May 29, 2004 at 09:44:50 Pacific
Reply:

thats pretty cool. so now when i wanna do something like that, i wont need any more frames. stupid frames

FBI_Agent


0

Response Number 3
Name: safeTsurfa
Date: May 29, 2004 at 11:04:04 Pacific
Reply:

@James

I have php include to pull in a search engine script on my site's search page, but I use SSI to pull in common header and footer across the whole site. I don't use .shtml, I use .html with Xbithack on instead, so it only parses the pages set for Owner execute.

In your view, which is better for the common elements, in terms of server burden, and which is more reliable overall? Load speed is fast for the visitor on my site anyway, so this comes down to optimising backend performance and miniminsing drain. Or maybe because the header and footer cache immediately, it really doesn't make much difference?


0

Response Number 4
Name: jam14online
Date: May 29, 2004 at 23:43:01 Pacific
Reply:

safeTsurfa,

I don't really think it makes much of a difference. For your search page, all the server has to do is perform a total of three file operations: one for the actual page, one for the search script that is included and another for the SSI header you have across the site.

Unless your server is overloaded with traffic and slowing down to turtle pace, I wouldn't worry about it. But, hey, that Xbithack thing is cool. I've never seen that before... ^_^


James



0

Response Number 5
Name: Khalid
Date: May 30, 2004 at 00:13:50 Pacific
Reply:

@ safeTsurfa

Since your html-files are parsed by SSI _AND_ the php-parser, I would recommend you to place the headers in the php-method also. That way the file is only parsed once, and can be sent to the client quicker.


0

Related Posts

See More



Response Number 6
Name: safeTsurfa
Date: May 31, 2004 at 00:23:10 Pacific
Reply:

@Khalid

Thanks, it's only the one page which parses with php as it performs a search. I will look at using php for the headers though, may try a test page with it.

@ James

Yep, I picked up the Xbithack trick a while back. I used to set a command in HTACCESS to parse all .html files, but this is better, as it only does it to those which need it and have the CHMOD set.


0

Response Number 7
Name: eli_hoehandle
Date: June 4, 2004 at 09:37:41 Pacific
Reply:

OK, I created a header file and and place the PHP statement on the first line of the CSS file, but it didn't work, I just lost my backgroud color. Next I tried to put the PHP statement in the page I was trying to load. It works but I loose some of my formating. Any suggestions would be appreciated.

Thanks


0

Response Number 8
Name: jam14online
Date: June 4, 2004 at 23:19:26 Pacific
Reply:

eli_hoehandle,

Please give us the URL to this page so we can see what you mean more clearly. You are certainly not supposed to place the PHP statement in the CSS file; that doesn't make sense!

You just need a page with your header in called header.php. Then you need another page, index.php for example, which contains the following line of code <u>in the HTML</u>:

<?php include("header.php"); ?>

Make sure the header.php page isn't actually a full page, i.e. doesn't have:

<html>
<head>
<title>Header Page</title>
<head>
...
etc

Post back here with the URL.

Thanks,


James



0

Response Number 9
Name: eli_hoehandle
Date: June 11, 2004 at 11:10:07 Pacific
Reply:

Can't post URL... not a public site, only internal. Below is a section of the index.php


include("../../header.php");

include_once("../inc/config.php");
start_session();
include_once("../inc/database.php");
include_once("../inc/isuser.php");
include_once("../lang/".$LANG_setting.".php");
include_once("../inc/skins/".$SKIN_name."/config.hcl");


$SKIN_type = "tt";
$SKIN_inner = "default";
$MAIN = "";

if ($TICKETS_login !== 1) {
if (isset($_GET["register"])) {
header("Location: ".$URL_maindir."/tt/user_login.php?".$sid."®ister=yes");
} else {
header("Location: ".$URL_maindir."/tt/user_login.php?".$sid);
}
exit;
}

if (!isset($_GET["x"])) {

$MAIN .= "<table width=\"90%\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\" class=\"border\">
<tr bgcolor=\"".$TABLE_hcolour."\">
<td><div align=\"center\">[".$LANG_open_tickets."] [".$LANG_closed_tickets."]</div></td>
</tr>
<tr>
<td>
<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">
<tr bgcolor=\"".$TABLE_hcolour."\">
<td width=\"50\"> </td>
<td width=\"70\"><div align=\"center\">".$LANG_tid."</div></td>
<td><div align=\"center\">".$LANG_subject."</div></td>
<td width=\"200\"><div align=\"center\">".$LANG_time_reply."</div></td>
<td width=\"70\"><div align=\"center\">".$LANG_urgency."</div></td>
</tr>
</table>";

$result_t = DATABASE_query("SELECT * FROM ".$DB_prefix."tickets WHERE username='$TICKETS_username' AND status='2' ORDER BY urgency DESC");
while($get = DATABASE_fetch($result_t)) {
$TICKET_foundo = 1;


0

Response Number 10
Name: eli_hoehandle
Date: June 11, 2004 at 11:20:11 Pacific
Reply:

I checked the Header.php file and removed all tags but the ones needed, but no change in results.

What I want is the header to be at the very top of the page...then a few lines down I want the PHP login box to be centered. The login page load correctly when the header is not included.

What I am getting is a few blank lines before the Header and then with no space in between I get the login box which is no longer centered, but on the left side. I can add line break commands into the login file but it adds the lines before the header and not in between the header and the login box the way I want it to be.


0

Response Number 11
Name: eli_hoehandle
Date: June 11, 2004 at 11:22:30 Pacific
Reply:

I am using an GPL program called Help Center Live and trying to customize the look to fit our needs. It is a Trouble ticket system. Thanks for the help so far. I am learning a lot working through this.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: CSS Question

css question www.computing.net/answers/webdevel/css-question/508.html

css question www.computing.net/answers/webdevel/css-question/2048.html

Simple CSS help? www.computing.net/answers/webdevel/simple-css-help/228.html