alexjewell
07-25-2006, 02:24 AM
I'm working on a weblog of mine, and I had this cool idea...
There's a lot of repeat code, so I decided to do this:
$thetitle = "
<div class=\"content\">
<div id=\"".$the_title."\"><h1>".$mrtitle."</h1></div>
<div class=\"cont\">
<div class=\"cont-container\">";
$thetitle2 = "
<div class=\"content\">
<div id=\"".$the_title2."\"><h1>".$mrtitle2."</h1></div>
<div class=\"cont\">
<div class=\"cont-container\">";
Then, when it came up:
if ($page == "about") {
$the_title = "us";
$the_title2 = "me";
$mrtitle = "About Us";
$mrtitle2 = "About Me";
echo "
$thetitle"."
<p>We're a branch of Flame Html Studios, a web design firm based in Cleveland, Ohio. This blog exists to
inform the public of interesting, helpful, entertaining, and practical topics relating to such things
as art, web design, programming, Faith, etc.</p>
<p>We strongly believe in the web standards set out by the W3C, and we strive to create out sites more
simple in every new design, idea, and line code that we spit out.</p>
"."$titlebot"."
$thetitle2"."
<p>My name is Alex Jewell. I'm a web designer, photographer, writer, artist, musician, and strong
Christian. As the founder and only designer, at this point, of Flame Html Studios, I learn more in the
realm of technology and design everyday. This blog is you learning what I do as I do.</p>
<p>I'm 14. I'm rad. I'm a geek. I love music. I love life. I love writing. I love design. Enjoy this
little project.</p>
"."$titlebot";}
See, this way I was making life a million times easier by stating what $the_title and $the_title2 were equal to later when I needed to, you know?
But this is throwing errors, saying they're undefined variables...since I state them in the document before I define them.
Any ideas?
There's a lot of repeat code, so I decided to do this:
$thetitle = "
<div class=\"content\">
<div id=\"".$the_title."\"><h1>".$mrtitle."</h1></div>
<div class=\"cont\">
<div class=\"cont-container\">";
$thetitle2 = "
<div class=\"content\">
<div id=\"".$the_title2."\"><h1>".$mrtitle2."</h1></div>
<div class=\"cont\">
<div class=\"cont-container\">";
Then, when it came up:
if ($page == "about") {
$the_title = "us";
$the_title2 = "me";
$mrtitle = "About Us";
$mrtitle2 = "About Me";
echo "
$thetitle"."
<p>We're a branch of Flame Html Studios, a web design firm based in Cleveland, Ohio. This blog exists to
inform the public of interesting, helpful, entertaining, and practical topics relating to such things
as art, web design, programming, Faith, etc.</p>
<p>We strongly believe in the web standards set out by the W3C, and we strive to create out sites more
simple in every new design, idea, and line code that we spit out.</p>
"."$titlebot"."
$thetitle2"."
<p>My name is Alex Jewell. I'm a web designer, photographer, writer, artist, musician, and strong
Christian. As the founder and only designer, at this point, of Flame Html Studios, I learn more in the
realm of technology and design everyday. This blog is you learning what I do as I do.</p>
<p>I'm 14. I'm rad. I'm a geek. I love music. I love life. I love writing. I love design. Enjoy this
little project.</p>
"."$titlebot";}
See, this way I was making life a million times easier by stating what $the_title and $the_title2 were equal to later when I needed to, you know?
But this is throwing errors, saying they're undefined variables...since I state them in the document before I define them.
Any ideas?