Closed Thread Icon

Preserved Topic: Loading content via PHP (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=21126" title="Pages that link to Preserved Topic: Loading content via PHP (Page 1 of 1)" rel="nofollow" >Preserved Topic: Loading content via PHP <span class="small">(Page 1 of 1)</span>\

 
CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 04-04-2002 20:19

I would like to appologize up front if this doens't make sense. I read where Doc designed one of his site recently that basically used a template and the content was loaded using PHP.

I was wondering if someone could point me in the right direction on how this is done. Maybe what to look for in the PHP Manual. I have the PHP Manual that came along with my phpDev from FirePages.

Any help would be greatly appreciated!

Later,
C:\


~Binary is best~

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 04-04-2002 20:59

Check out warmage's tute over at the gn.

Great little primer.



.:[ The Tao of Steve ]:.
Be Desireless
Be Excellent
Be Gone
...................................

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 04-04-2002 21:01

On the recent projects I think I remembered something about MySQL or a database or something. I am not 100% on this.

If it was from a database the file would resemble:

code:
<?php
//PHP code to call information from the database.
?>
<html>
<head>
<title>Site Title - <?php echo("$pageTitle");?></title>
</head>
<body>

<?php echo("$pageContent");?>

</body>
</html>



If he was not using a database then he probabally had content pages where he would pull the content into the page based on some variables or a query string such as in XSSI.

The supplied query string would resemble: template.php?page=testPage.html

code:
<html>
<head>
<title>Some Page</title>
</head>
<body>
<?php include($DOCUMENT_ROOT . "/content/$page"); ?>
</body>
</html>



The above variable $page corresponds to the query string.

It would not be this simplistic because you will have to account for an empty string so you have to check it, and the rest supply default content and what not.

You can do a lot of different things with different ways of doing it. Good luck with it and what not.

-mage-

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 04-04-2002 21:03

Damn you got that in there just before me...

Yeah check those out too, they are not great resources but they will give you the basics... I don't know... I am sure I could have done those tut's a bit better...

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 04-04-2002 21:24

Thanks guys.

I think that WarMage's second way of doing it is the way that I would prefer to do it. I don't really want to have to put everything in a datatbase. I will check out my manual on XSSI and read up on some things.

Like I said I am not that good at PHP yet and a lot of this is really new to me.

Thanks again and as always You Guys Rock!

Later,
C:\


~Binary is best~

cycus
Nervous Wreck (II) Inmate

From:
Insane since: Nov 2000

posted posted 04-04-2002 21:34

here are some more links that you might find useful, i am sure they have been linked before in other posts, but they have good tuts.

www.devshed.com
www.phpbuilder.com

-cycus
here is a page i am working on, with php/mysql: questlog.beastmeat.com

[This message has been edited by cycus (edited 04-04-2002).]

« BackwardsOnwards »

Show Forum Drop Down Menu