Say that I wanted to make a file that had stuff like
<?php
$title = "omg hi";
$content = "PENIS";
echo "<title>$title</title></br> <table><tr><td>cool table</td></tr><tr><td>$content</td></tr></table>";
?>
I know that would make the title omg hi and show PENIS in the table.
but what if I were to
<?php
echo "<title>$title</title></br> <table><tr><td>cool table</td></tr><tr><td>$content</td></tr></table>";
?>
<?php
$title = "omg hi";
$content = "PENIS";
include("foobar.php");
?>
Would that work to load the file with the table, and replace the variables with the definition?
Actually, I just tested it and it did work. ;0
...yep
Quote from: russell on December 05, 2008, 02:09:46 PM
...yep
Yeah, I am getting tired of editing like 3043040 pages when I can just use 3 lines of code each.
<?php
$title ='';
$bodyContent ='';
require("template.php");
?>
and then be all template .php with
<html>
<head>
<?php echo "<title>$title</title>"; ?>
<tag to load css shit>
</head>
<body>
<blah blah blah><?php include("navbar.php"); ?> </blah>
<blah blah blah next row> <?php include("$bodyContent"); ?></blah>
<rest of tags and shit>
So things like index.php would just have
<?php
$title ='INDEXTITLE LOL';
$bodyContent ='indexText.txt';
require("template.php");
?>
baddood;
It'd make changing the layout much easier since I'd only have to edit one file instead of each page.
Something is wrong with the code in the last post. :(
triple post. baddood;
There was no problem with the code.
Aparently copypasting my own code from the forum into smultron copied the line numbers which I overlooked since they were line numbers.
Quote from: Angry Kewn Fruit on December 05, 2008, 02:53:57 PM
triple post. baddood;
There was no problem with the code.
Aparently copypasting my own code from the forum into smultron copied the line numbers which I overlooked since they were line numbers.
when I was your age we didn't even have line numbers
Quote from: russell on December 05, 2008, 03:27:33 PM
when I was your age we didn't even have line numbers
They're taking away line numbers in the future?
FUCK