User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,508 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,677 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1729 | Replies: 9
Reply
Join Date: Sep 2007
Posts: 21
Reputation: mag00 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mag00 mag00 is offline Offline
Newbie Poster

php header include on html? (picture gallery)

  #1  
Sep 26th, 2007
Fairly new to this, and looked around on the net and didn't readily find my answers.

I am setting up picture pages, thousands, and want to be able to change header or footer information down the road as the site expands.

I am on godaddy non windows hosting.

I need my pages to stay with .html

So when I create my header, would I create that and then use the php extension on the file? Do I need php script within that file? Special code for the header file, and is that a php or html?

Pages are quite simple http://freehelpings.com/freephotos and I am going to use a page generator to make the pages later, using each picture.

Then as I advance through this process, I will want to make a thumbnail gallery with link to each picture page.

I have some wonderfull ideas on how I want my gallery to work, but totally lack the expertice in programming to make it happen at this time.

None of the photo galleries do what I need. I am hoping also to incorporate the opendb software down the line to help in searching for the content.

Considering I have thousands of photos and going after more, I need to automate as much as possible. I tried zenphoto http://snailrider.com/zenphoto but do not really like it. It is simple and fairly easy, but I cannot optimize each picture page like I want, and I really don't care about comments etc.

So how would I set up the php header include?

Thanks,
Dave
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: Morrisdale, PA
Posts: 52
Reputation: JeniF is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 5
JeniF's Avatar
JeniF JeniF is offline Offline
Junior Poster in Training

Solution Re: php header include on html? (picture gallery)

  #2  
Sep 26th, 2007
Originally Posted by mag00 View Post
Fairly new to this, and looked around on the net and didn't readily find my answers.

I am setting up picture pages, thousands, and want to be able to change header or footer information down the road as the site expands.

I am on godaddy non windows hosting.

I need my pages to stay with .html

So when I create my header, would I create that and then use the php extension on the file? Do I need php script within that file? Special code for the header file, and is that a php or html?

Pages are quite simple http://freehelpings.com/freephotos and I am going to use a page generator to make the pages later, using each picture.

Then as I advance through this process, I will want to make a thumbnail gallery with link to each picture page.

I have some wonderfull ideas on how I want my gallery to work, but totally lack the expertice in programming to make it happen at this time.

None of the photo galleries do what I need. I am hoping also to incorporate the opendb software down the line to help in searching for the content.

Considering I have thousands of photos and going after more, I need to automate as much as possible. I tried zenphoto http://snailrider.com/zenphoto but do not really like it. It is simple and fairly easy, but I cannot optimize each picture page like I want, and I really don't care about comments etc.

So how would I set up the php header include?

Thanks,
Dave


Dave,
Is there some really good reason to have the pages end with a .html? PHP can read a plain old html file without any php coding in it. If you are on a GoDaddy server (which I have a few sites on thier servers) and it is a non windows server, most likely it is a linux or unix server. Simply change the name of index.html to index.php
To include a header in the file, design your site and break down the header and footer sections into their own page (i.e. header.php or footer.php) then use an include statement in your page
[inlinecode]
<? include('header.php'); ?>
[/ILINECODE]
The content of your site (body) would start just below that. After the content you would include footer.php

<? include('footer.php'); ?>

example of header.php

<!-- Begin the outer container table -->
<table width="750" border="0" cellspacing="0" cellpadding=" 0">
<!-- begin graphical header -->
<tr>
<td colspan="13"><img src="bannerImage.jpg" width="750" height="100" alt="this is my banner "></td>
</tr>
<!-- end graphical header -->


footer.php example

//end container
<tr>
<td width="730" height="60" colspan="12" align="left" valign="middle" background="images/Footer.jpg"><p class="footerText">Today's Date:<?php echo date(' F j,Y');?><br>
More text here if you want.
</td>
</tr>
</table>

Make sure your container tags are started and ended correctly. Here I bolded the ending table row and starting table row
Your index.php page can now look like this:

<body>
<? include('header.php'); ?>
<table width="500" border="0">
<tr>
<tdHere is the content of you web page</td>
<td>Set up with a table in the middle of the header and footer</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<? include('footer.php'); ?>

That's a very basic run through, you can do so much more!!!
Hopefully this will at least steer you in the right direction.
I keep hitting "escape", but I'm still here!!!!
:}
Reply With Quote  
Join Date: Sep 2007
Posts: 21
Reputation: mag00 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mag00 mag00 is offline Offline
Newbie Poster

Re: php header include on html? (picture gallery)

  #3  
Sep 26th, 2007
Yes I need html as that is what format the generator makes for the pages.

I am going to study up on your post for the future so thanks much. I want to work more with php in the future, and not real clear on the container thing, I noticed some of my forums use a container (at least in the css I see it)

Thanks
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: php header include on html? (picture gallery)

  #4  
Sep 26th, 2007
there is no way to do this html coding.
Reply With Quote  
Join Date: Sep 2007
Posts: 21
Reputation: mag00 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mag00 mag00 is offline Offline
Newbie Poster

Re: php header include on html? (picture gallery)

  #5  
Sep 27th, 2007
Do I understand correctly?

If the page is .html, the php include will not work?

That really sucks, so then I would have to use frames?
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: php header include on html? (picture gallery)

  #6  
Sep 27th, 2007
in html, no! only with frames.

you cannot include any type pages to html without frames.

What is wrong with PHP, ASP etc? You wrote there already GoDaddy servers are Linux or Unix, so PHP can work on them.
Last edited by fatihpiristine : Sep 27th, 2007 at 2:00 pm.
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Practically a Master Poster

Re: php header include on html? (picture gallery)

  #7  
Sep 27th, 2007
you can use php in html files as long as the server is configured for it. i have my own server and i can make any extension i want. this includes .html files http://68.103.192.2:8080/show.haha
Last edited by kkeith29 : Sep 27th, 2007 at 3:06 pm.
Reply With Quote  
Join Date: Sep 2007
Posts: 21
Reputation: mag00 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mag00 mag00 is offline Offline
Newbie Poster

Re: php header include on html? (picture gallery)

  #8  
Sep 27th, 2007
I guess I'm going to have to do some experimenting.

OK a little bit off of php, but still trying alternatives to a dynamic header. What about and <object>, but I don't want to use flash buttons. Could I create a text object or have the object a php file?
Reply With Quote  
Join Date: Sep 2007
Posts: 21
Reputation: mag00 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mag00 mag00 is offline Offline
Newbie Poster

Re: php header include on html? (picture gallery)

  #9  
Sep 27th, 2007
I found this little tidbit, but don't think I want to use this method, but is yet another option.
(seems like a bandwidthe burglar)
You can run PHP code in .html files. If you add:

AddType application/x-httpd-php .php .html

to your .htaccess file, all pages with a .html extension will also be parsed by PHP. So you can keep your current .html pages, and add PHP code to them.

I am not concerned about the footer or header being search engine friendly. So I guess frames.
Reply With Quote  
Join Date: Sep 2007
Posts: 21
Reputation: mag00 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mag00 mag00 is offline Offline
Newbie Poster

Re: php header include on html? (picture gallery)

  #10  
Sep 27th, 2007
Well it sortof works now with <iframe> Now on to getting more categories etc. http://freehelpings.com/freephotos

Thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC