HighDots Forums  

PHP Includes with Head content not working!

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss PHP Includes with Head content not working! in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TimPlaster
 
Posts: n/a

Default PHP Includes with Head content not working! - 06-21-2004 , 07:15 PM






I am trying to include a php page that has head content, and it's not working
for me. The include I am using is a Magic Menu from Project Seven, and includes
both CSS files (referenced to) and rollover script contained in the head of the
file. This seems so stinkin easy, but I can't figure it out! Help!
Thanks in advanced.
Tim


Reply With Quote
  #2  
Old   
Gary White
 
Posts: n/a

Default Re: PHP Includes with Head content not working! - 06-21-2004 , 11:14 PM






"TimPlaster" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I am trying to include a php page that has head content, and it's not
working
for me. The include I am using is a Magic Menu from Project Seven, and
includes
both CSS files (referenced to) and rollover script contained in the head
of the
file. This seems so stinkin easy, but I can't figure it out! Help!

Hmmm... I guess I could say that it works for me. ;-) The statement that
"it's not working" doesn't really provide anyone anything to go on do
diagnose an unknown problem. What exactly isn't working? What does the
content of the include file look like? How are you trying to include it?

Gary




Reply With Quote
  #3  
Old   
TimPlaster
 
Posts: n/a

Default Re: PHP Includes with Head content not working! - 06-21-2004 , 11:59 PM



I guess my question really, is how do you include a PHP file in a page, when
the PHP file you're trying to include has head content such as javascrip
rollovers and a preload tag in the body tag? Is it possible? Is it possible to
create a complete PHP page with javascrip rollovers and other head content and
simply include the file "as is" into another page? Or does the file need to be
stripped of the <head> and <body> tag in order to work?


Reply With Quote
  #4  
Old   
Michael Fesser
 
Posts: n/a

Default Re: PHP Includes with Head content not working! - 06-22-2004 , 05:21 AM



.oO(TimPlaster)

Quote:
I guess my question really, is how do you include a PHP file in a page, when
the PHP file you're trying to include has head content such as javascrip
rollovers and a preload tag in the body tag?
Sure, you can put whatever you want in your PHP inclues, it doesn't
really matter.

Quote:
Is it possible? Is it possible to
create a complete PHP page with javascrip rollovers and other head content and
simply include the file "as is" into another page? Or does the file need to be
stripped of the <head> and <body> tag in order to work?
Depends. The result after parsing and executing the PHP code has to be
one HTML page with one head-element, one body etc. If this page is
generated from a single PHP file or from hundred is not an issue.

Micha


Reply With Quote
  #5  
Old   
TimPlaster
 
Posts: n/a

Default Re: PHP Includes with Head content not working! - 06-22-2004 , 03:08 PM



Okay, I think you guys said two different things. So what if I have this
scenario: I have a regular PHP page with content, javascript, a few databases,
and some preloaded images. Now, I want to insert an include that also contains
javascript and some preloaded images. Can I successfully do this? Or are
includes limited to plain html with no head content? I don't get it. Thanks for
your replies.
Tim


Reply With Quote
  #6  
Old   
Alan
 
Posts: n/a

Default Re: PHP Includes with Head content not working! - 06-22-2004 , 03:12 PM





Quote:
Now, I want to insert an include that also contains
javascript and some preloaded images.
the big thing is, you can't include just any old thing anyplace- what is
included has to be correct syntax for WHERE it's put in the real file- so
that the total assembled real document served is correct syntax. Doesn't
have four <body> tags and fun things like that.

the included file should not be a complete html document in almost any case.

so- your javascript functions belong in the head section of the real
document (preferable- put them in a linked external .js file)

the onload events, put them in the body tag of the real document.
Or better, go to http://projectseven.com -->extensions and get the "RunEm"
extension. Lets you trigger functions without messing with the body tag.



Reply With Quote
  #7  
Old   
TimPlaster
 
Posts: n/a

Default Re: PHP Includes with Head content not working! - 06-22-2004 , 03:37 PM



I'm starting to get it! Thanks guys! I was running in circles thinking this was
a LOT easier than it is! Don't get me wrong, it's still easy, but there's more
to it, and it makes sense. That's why we webmasters are getting the big bucks,
right? ha Thanks guys.
Tim


Reply With Quote
  #8  
Old   
Michael Fesser
 
Posts: n/a

Default Re: PHP Includes with Head content not working! - 06-22-2004 , 05:20 PM



.oO(TimPlaster)

Quote:
I'm starting to get it! Thanks guys! I was running in circles thinking this was
a LOT easier than it is!
Actually it is easy.

Quote:
Don't get me wrong, it's still easy, but there's more
to it, and it makes sense.
Just one more note: Don't think of PHP includes in the way that there
are multiple files sent to the browser. Even if you include a hundred
files in one page - the final result the server delivers is _one_ single
page, containing the code (or the resulting output) of all includes.

Micha


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.