headers and footers

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

shufty
New php-forum User
New php-forum User
Posts: 6
Joined: Sat Aug 17, 2002 5:45 am

headers and footers

Postby shufty » Sat Aug 17, 2002 6:01 pm

How would i create a file that has the header and footer code in it so it can be required into a page and the header and footer got out of it?

eg.

in a poll, i:

Code: Select all

<?php require('booth.php'); ?>
and at the poll's location, i have

Code: Select all

<?php echo $php_poll->poll_process(newest); ?>


like this but with multiple processes.

any help?

DoppyNL

Postby DoppyNL » Tue Aug 20, 2002 5:31 am

I'm not exactly sure what you mean, but perhaps this helps:

create a file wich contains 2 functions to print the header and the footer of you're page.

Code: Select all

function print_page_header()
{
    printstuff();
}
function print_page_footer()
{
    printstuff();
}

requere that function in you're script, and simply call the function.
you can also create just one function wich uses a parameter (header or footer).

pretty simple I guess, but then again, I probably mis-understood you :roll:
:mrgreen:

Greetz Daan

Jay

Postby Jay » Tue Aug 20, 2002 1:46 pm

I hope you don't mind me asking this question, but your post in this form reflects an OOP command, which means you are making use of classes. This is quite a complicated feature of PHP (I myself don't understand it fully). Yet on the other forum you seemed to have trouble with 'declaring' variables and using 'GET' variables, both of which are very basic.

I'm confused :?: :wink:


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron