nanode
03-01-2001, 12:42 PM
On my site I include a common file that supplies an HTML header and a handful of PHP variables. The variables are simply color values, that get used in each page that includes the header file.
This makes it really easy to change the font or background color of my entire site - just change 1 file.
Anyhow, I was wondering how I could implement dynamic changes to those color variables. I considered making a small form in HTML, but I'm not sure how I could POST to it since it's an included file and not actually a true webpage.
Here's the included file in question:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<title>yunt.net</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body
bgcolor="000000"
text="000000"
LINK="000000"
ALINK="000000"
VLINK="000000"
<?php
$bgimg = "/images/backgrounds/wind_paper.gif";
echo "background=$bgimg";
echo ">";
?>
<style>A:hover {color:black}</style>
<CENTER>
<?php
$bg = "#CCCCCC";
$altbg = "#FFFFFF";
$font = "#000000";
$altfont = "#FFFFFF";
?>
<?php
echo "\n<table border=0 cellspacing=0 cellpadding=0 width=100% bgcolor=#000000><tr><td>";
echo "\n<table cellpadding=0 cellspacing=1 width=100% border=0><TR><TD>";
echo "\n<table cellpadding=3 cellspacing=0 width=100% border=0>";
echo "\n<TR><TD colspan=4 align=center bgcolor=$bg>";
echo "\n<FONT face=arial color=$font size=6>yunt.net</FONT></TD></TR>";
echo "\n<TR align=center bgcolor=$bg><TD><A HREF=\"/\" style=\"text-decoration: none\">";
echo "\n<FONT face=arial color=$font size=2>home</FONT></A></TD>";
echo "\n<TD><A HREF=\"/network\" style=\"text-decoration: none\">";
echo "\n<FONT face=arial color=$font size=2>network</FONT></A></TD>";
echo "\n<TD><A HREF=\"mailto:seanyunt@hotmail.com\" style=\"text-decoration: none\">";
echo "\n<FONT face=arial color=$font size=2>email me</FONT></A></TD>";
echo "\n<TD><A HREF=\"/photo_gallery\" style=\"text-decoration: none\">";
echo "\n<FONT face=arial color=$font size=2>images</FONT></A></TD></TR>";
?>
</table>
</TD></TR></TABLE>
</TD></TR></TABLE>
<HR>
<font size="2" face="Helvetica, Arial, San Serif">
The page that includes it supplies all the closing tags.
I don't need to do this, so I won't bust my *** working on it, but I think it'd be cool.
This makes it really easy to change the font or background color of my entire site - just change 1 file.
Anyhow, I was wondering how I could implement dynamic changes to those color variables. I considered making a small form in HTML, but I'm not sure how I could POST to it since it's an included file and not actually a true webpage.
Here's the included file in question:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<title>yunt.net</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body
bgcolor="000000"
text="000000"
LINK="000000"
ALINK="000000"
VLINK="000000"
<?php
$bgimg = "/images/backgrounds/wind_paper.gif";
echo "background=$bgimg";
echo ">";
?>
<style>A:hover {color:black}</style>
<CENTER>
<?php
$bg = "#CCCCCC";
$altbg = "#FFFFFF";
$font = "#000000";
$altfont = "#FFFFFF";
?>
<?php
echo "\n<table border=0 cellspacing=0 cellpadding=0 width=100% bgcolor=#000000><tr><td>";
echo "\n<table cellpadding=0 cellspacing=1 width=100% border=0><TR><TD>";
echo "\n<table cellpadding=3 cellspacing=0 width=100% border=0>";
echo "\n<TR><TD colspan=4 align=center bgcolor=$bg>";
echo "\n<FONT face=arial color=$font size=6>yunt.net</FONT></TD></TR>";
echo "\n<TR align=center bgcolor=$bg><TD><A HREF=\"/\" style=\"text-decoration: none\">";
echo "\n<FONT face=arial color=$font size=2>home</FONT></A></TD>";
echo "\n<TD><A HREF=\"/network\" style=\"text-decoration: none\">";
echo "\n<FONT face=arial color=$font size=2>network</FONT></A></TD>";
echo "\n<TD><A HREF=\"mailto:seanyunt@hotmail.com\" style=\"text-decoration: none\">";
echo "\n<FONT face=arial color=$font size=2>email me</FONT></A></TD>";
echo "\n<TD><A HREF=\"/photo_gallery\" style=\"text-decoration: none\">";
echo "\n<FONT face=arial color=$font size=2>images</FONT></A></TD></TR>";
?>
</table>
</TD></TR></TABLE>
</TD></TR></TABLE>
<HR>
<font size="2" face="Helvetica, Arial, San Serif">
The page that includes it supplies all the closing tags.
I don't need to do this, so I won't bust my *** working on it, but I think it'd be cool.