Dario D.
Spy
- Joined
- Nov 30, 2004
- Messages
- 710
- Reaction score
- 0
--- UPDATE: Got working now by examining the source code. ----
If you're reading this, I guess you might know how php works
Basically, I've setup some files as such:
root folder:
index.php
header.php
footer.php
navigate.php
main.php
gameplay.php
(and a few others)
And under "base" folder I have the same exact filenames as above,
but different content inside them. The files under base folder have the actual Data, whereas the files in Root Folder only POINT to the base folder files.
So here's what I did:
I made an index.php file that goes as follows:
Then I copy/pasted that index.php file and renamed it to the names of all the files in Base folder. I also changed one line of code in each one to point to the files in base folder, like this: (this code is from gameplay.php in the Root Folder)
Notice where Index.php said
<?php include('main.php')
it now says
<?php include('gameplay.php')
So anyway, the final result is that when I visit the index.php page, nothing shows up. ...at all. The page takes forever to load, and all I see is the background color.
So obviously something is wrong.
You can see it here:
http://www.deefrag.com/hl2/war/index.php
Any ideas what I did wrong? I think I missed a step in the php process. Someone just explained it to me today, so I'm still getting the hang of it.
If you're reading this, I guess you might know how php works
Basically, I've setup some files as such:
root folder:
index.php
header.php
footer.php
navigate.php
main.php
gameplay.php
(and a few others)
And under "base" folder I have the same exact filenames as above,
but different content inside them. The files under base folder have the actual Data, whereas the files in Root Folder only POINT to the base folder files.
So here's what I did:
I made an index.php file that goes as follows:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>War</title>
</head>
<body bgcolor="#D1DCEB">
<div align="center">
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" valign="top"><?php include('./header.php'); ?></td>
</tr>
<tr>
<td valign="top"><?php include('./navigate.php'); ?></td>
<td valign="top"><?php include('main.php'); ?></td>
</tr>
<tr>
<td colspan="2" valign="top"><?php include('./footer.php'); ?></td>
</tr>
</table>
</div>
</body>
</html>
Then I copy/pasted that index.php file and renamed it to the names of all the files in Base folder. I also changed one line of code in each one to point to the files in base folder, like this: (this code is from gameplay.php in the Root Folder)
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Gameplay</title>
</head>
<body bgcolor="#D1DCEB">
<div align="center">
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" valign="top"><?php include('./header.php'); ?></td>
</tr>
<tr>
<td valign="top"><?php include('./navigate.php'); ?></td>
<td valign="top"><?php include('gameplay.php'); ?></td>
</tr>
<tr>
<td colspan="2" valign="top"><?php include('./footer.php'); ?></td>
</tr>
</table>
</div>
</body>
</html>
Notice where Index.php said
<?php include('main.php')
it now says
<?php include('gameplay.php')
So anyway, the final result is that when I visit the index.php page, nothing shows up. ...at all. The page takes forever to load, and all I see is the background color.
So obviously something is wrong.
You can see it here:
http://www.deefrag.com/hl2/war/index.php
Any ideas what I did wrong? I think I missed a step in the php process. Someone just explained it to me today, so I'm still getting the hang of it.