php problems (solved)

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:

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.
 
The page looks alright, except the main window isn't centered, its shifted slightly to the right. You could do alot better by using CSS for your positioning and layout of your table.
 
I know... Im currently tinkering with Dreamweaver (just got it today - normally I used FrontPage 2003), trying to figure out how to get CSS working.

It's too bad I dont have time to just sit down for days on end and learn it.

Seems simple enough, but I would need a little tutorial or something to figure out how to actually use it. :monkee:
 
I will make a mock page for you quickly later on today so you can get the basic idea when it comes to css positioning.

EDIT: Sorry don't have enough time to do this, but experiment with dreamweaver.
 
I know... Im currently tinkering with Dreamweaver (just got it today - normally I used FrontPage 2003), trying to figure out how to get CSS working.
I just use http://www.w3schools.com/ for any help I need...the rest I do by hand in PHP Expert Editor(Can preview PHP offline and Colored Syntax... only helpfull things in it that make me use it instead of notepad).
 
duffers20 said:
I will make a mock page for you quickly later on today so you can get the basic idea when it comes to css positioning.

EDIT: Sorry don't have enough time to do this, but experiment with dreamweaver.

Thanks :rolling: Well don't worry, I think I got it under control. I got a program called TopStyle, which automates the process of creating a CSS page.

Dreamweaver also makes it just about as easy as top-style, except Im not sure how to preview what I'm doing to the CSS.

I just use http://www.w3schools.com/ for any help I need...the rest I do by hand in PHP Expert Editor(Can preview PHP offline and Colored Syntax... only helpfull things in it that make me use it instead of notepad).

Thanks. www.w3schools.com seems very helpful :)
I can preview PHP pretty easily with FrontPage. Publishing files is super-easy and powerful in FrontPage, then I just click Refresh in the browser to see the changes. Takes about 5 seconds to go from editing a bunch of PHP pages to seeing the changes in IE.

Im still getting the hang of Dreamweaver, but so far I can't find an easy way to publish specific files without publishing the whole site.

Seems super powerful, but a little counter-intuitive when it comes to simple tasks like manageing your Site's file tree back-to-back with your remote site's file tree and interchanging files that way. Haven't figure that part out yet.
 
Back
Top