The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Setting Header/Footer dynamically in page
SteveD
post Aug 21 2007, 08:44 PM
Post #1


Newbie
*

Group: Members
Posts: 18
Joined: 16-November 06
From: Iowa
Member No.: 936



I'm trying to print web-based forms, some of the forms are more than one page so I would like some basic, identifying information to be displayed in a header or footer on the pages. I don't know where the browser is going to do a page break as the forms can be varying lengths depending on how much text users enter.

Is there any way to set the text in a header/footer? I'm generating my html with a php script, running on a Windows server.

Thanks,
Steve
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies(1 - 9)
Peter1968
post Aug 21 2007, 09:04 PM
Post #2


Serious Coder
*****

Group: Members
Posts: 448
Joined: 23-September 06
Member No.: 213



Since you're using PHP, check out its include() function. That's probably what you are after.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SteveD
post Aug 21 2007, 09:50 PM
Post #3


Newbie
*

Group: Members
Posts: 18
Joined: 16-November 06
From: Iowa
Member No.: 936



QUOTE(Peter1968 @ Aug 21 2007, 09:04 PM) *

Since you're using PHP, check out its include() function. That's probably what you are after.


I don't understand, Include() will include a file, I'm not sure how that will happen at the top or bottom of every printed page. Maybe at the top or bottom of the html page, but when I print I would like pages 2, 3, 4, etc., to have the user's name displayed so the administrator printing these forms doesn't get the pages mixed up.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Aug 21 2007, 09:50 PM
Post #4


WDG Member
********

Group: Root Admin
Posts: 8,291
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



I don't think that's what SteveD is looking for. I think he's looking for a way to put a common header/footer on each printed page.

I don't know of a way to do what he wants to do.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
garrettstj
post Aug 21 2007, 09:57 PM
Post #5





Group: Members
Posts: 9
Joined: 21-August 07
From: N. California, US
Member No.: 3,598



This sounds like more of an issue with a browser setting than a scripting/coding issue. You can change headers/footers in your browser before printing:

--- IE 7 ---
1. File > Page Setup...
2. Make modification to Header and Footer
a. It appears that &p represents current page and &P represent total pages

--- FF 2 ---
1. File > Page Setup...
2. Go to the 'Margins & Header/Footer' tab
3. In the 'Headers & Footers' section select the information you would like to display.

Hope this is what you are aiming for help on...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SteveD
post Aug 21 2007, 10:15 PM
Post #6


Newbie
*

Group: Members
Posts: 18
Joined: 16-November 06
From: Iowa
Member No.: 936



No, I'm trying to print html forms from data in a database. So if there are 5 entries in the database I'll get 5 forms printed out. I have an html formatted form so I get one long listing on the computer monitor, which is ugly, but printed out the administrator will get these nicely laid out paper forms.

Since each form may be 2 or more pages long, I'd like to have a unique identifier at the top or bottom of each printed page just to keep them all organized. I was hoping there was a simple CSS or html type of a setting/tag that would change the browser header/footer, or display a text string at every page break.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
garrettstj
post Aug 22 2007, 12:38 AM
Post #7





Group: Members
Posts: 9
Joined: 21-August 07
From: N. California, US
Member No.: 3,598



Ahh....I understand now. Well, I'm with Darin...I've never seen anything like this. The issue is that the browser is the one deciding the page breaks, but by then it is too late to do anything with CSS.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 22 2007, 02:45 AM
Post #8


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,178
Joined: 9-August 06
Member No.: 6



Is this an inhouse thing? That is, can you control what browser will be used to print out the forms? because if you can avoid MSIE I think it's possible.

If you have a useable TITLE that identifies the form you can make the title visible on the page by making HEAD and TITLE 'display: block'. Or you could use generated content.
CODE
body:before   { content: "My Unique Identifier" }


How to get the identifiers in there is another problem. tongue.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 22 2007, 06:54 PM
Post #9


.
********

Group: WDG Moderators
Posts: 8,067
Joined: 10-August 06
Member No.: 7



You might use a table, since some browsers let THEAD and TFOOT elements repeat on each new paper: http://css-discuss.incutio.com/?page=PrintingTables

Another idea might be to let CSS control where a page should be broken, and add the "identifying information" there: http://www.w3.org/TR/CSS21/page.html#page-breaks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SteveD
post Aug 22 2007, 10:00 PM
Post #10


Newbie
*

Group: Members
Posts: 18
Joined: 16-November 06
From: Iowa
Member No.: 936



The <THEAD> works great with Firefox, no go with IE 7. It's an internal application and I know the two users of the program. One uses Firefox, the other I'm not sure - I'll persuade her to use Firefox!!

Thanks for the help - I learn something new every day.
Steve
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2019 - 03:12 AM