Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / PHP Questions

Author
Message
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 12th Jun 2004 22:46
I have a few PHP questions that I hope can be answered in a way that I can understand.

1) I am designing my site as of now, and I would like to know how I can design the site in HTML, but in the main content area, have the content from a .txt file shown in the content table.

2) I have tried the tutorials on davidtattersal.me.uk for Clever Content but cannot understand how to implement them into an HTML design I have made.

Thanks in Advance

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 13th Jun 2004 00:34
1) You would use this code:



Usage:

Go to the url

www.domain.com/whatever.php?page=main
To include main.txt

www.domain.com/whatever.php?page=stuff
To include stuff.txt

etc.

2) I'm flattered somebody's read my tutorial!

For anybody interested URL is
http://designingthe.net?articles/php/cms/

I'm assuming you already have the completed script:



To add your own HTML template simply place any HTML code around the line



So for example your modified code might look like this:



Good luck

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 13th Jun 2004 00:41 Edited at: 13th Jun 2004 00:46
OK, but what if my whole website right now uses tables?

Can you give me an example how I would use your script to put text in the section where the main content is? My source for the page is:




There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 13th Jun 2004 00:49
I'm afraid I haven't looked at your code in full, but here's an example of a normal page that uses tables:



To use that in my script modification I detailed above, you would copy all HTML before "CONTENT GOES HERE" into header.htm and all content thta goes after that into footer.htm.

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 13th Jun 2004 01:25 Edited at: 13th Jun 2004 01:31
Well, David, when you have time can you go through my code and put it in the form so I can use it, because the way I did it was not even close to working.

Here is the code I tried.

index.php:



header.html:



footer.html:



test.html:


There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 13th Jun 2004 13:17
David i've read your tutorials


Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 13th Jun 2004 14:35
Well, I'd like to use my design, but since this is confusing, I am going to use PHP nuke, and maybe use this if more help is posted.

Regards

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 13th Jun 2004 18:27 Edited at: 13th Jun 2004 18:30
Glad you decided to wait all of one hour to get help

Okay, firstly can you post up what error you get (if there is one) - I pasted your header and footer HTML into my editor and it just showed a blank page :/

Secondly I'll try this afternoon to get your code working and a version of it running on my server.

Things to do:

- Try to replace your complex HTML with a simple text design - if that does work then it's a problem with your HTML (you may wat to rewrite it). And idea might just be to completely remove theh eader nad footer and just check that everything is included properly.
- Make sure that in the same folder as your index.php there is a folder called pages. Within that folder place test.html.
- Call index.php without any paraeters and the pages/test.html file should be included.
- Then create a folder within pages called test/. Inside that again place another version of test.html with any content you want in, and call index.php?test/ - you should see the content from pages/test/test.html included.

Once everything is set up it's not that confusing at all. Just craete a new folder for every section of your site, it provides not only a logical look at things but and easy way to maintain the site and memorable URLs.
PHPNuke is IMO incredibly useless for normal web sites- it doesn't focus on content, more on portals. You'd be hard pressed to work with PHPNuke and get some decent content management in.

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 13th Jun 2004 21:16
Thanks David T

If you get it working, please post, if not, I am working on a very simple design.

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.

Login to post a reply

Server time is: 2024-09-22 02:44:20
Your offset time is: 2024-09-22 02:44:20