🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

php help

Started by
5 comments, last by jumpjumpjump 20 years, 4 months ago
i just started to learn some php and the book I have does not tell you how to load other documents. This is what i want to do. I want to take for instance say i right a document called midpage.pg, this would be part of my page from the < body > tag down to the < /body > tag and it would automagically write that page, then move on to loading the bottom part of the page. How would I do this? I need it for the tutorial maker script I am writing. Thanks in advanced. RedHat baby My Homepage | My Forums Please Register | Google
Advertisement
The ''include'' or ''require'' functions allow you to import other documents and insert them into the current document. Usually you use this with other PHP pages but I expect you can just insert an HTML document too.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
check the documentation on http://www.php.net/ its simply a great learning source if you already are into programming

i also recommend the chm help file you can find there if you work on windows
http://mitglied.lycos.de/lousyphreak/
I want it to automatically import it and write it. Cus the file I am loading is just a bunch of tables that will constantly be updated. Making it without any functions in it will allow me to write to it easier. How would i do that? Some one on phpbb.com told me to use file_get_contents but thats not a function.

RedHat baby
My Homepage | My Forums Please Register | Google
<? readfile("midpage.pg"); ?>
--Riley
ok it is a function but 1and1 does not have it enabled or do not have the right version of php.
Why don''t you just use include() like Kylotan suggested? If you tried it you''d see that it works (if I understand you correctly).

Let''s say you have a separate HTML file just for the body area, since that seems to be what you''re saying. Then in the PHP file, you''d have this:
</head><body><? include(''Body.html''); ?></body></html>

Get it?

~CGameProgrammer( );

Screenshots of your games or desktop captures -- Post screenshots of your projects. There''s already 134 screenshot posts.
~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement