chrometweaks.org

So I'm new to web hosting...and I just bought a domain at iPage.com?

Click Here To View All Answers...


Got a question... So I'm new to web hosting...and I just bought a domain at iPage.com? Thanks for any answer. My 2nd question... I want to pull my own header bar (called ddheader.htm which is in my iPage site root) into the catalog/includes/header.php..

How would I pull (using include or whatever) it in to the header.php and still keep all the paths working. I tried the code below but didn't work..

(Snipit from header.php near line 60).

<tr class="header">.

<td align="center" valign="middle"><?php include ('../../ddheader.htm'); ?></td>.

<td align="right" valign="bottom"><?php echo '<a href="'tep_href_link(FILENAME_ACCOUNT, '', 'SSL')'">'tep_image(DIR_WS_IMAGES'header_account.gif', HEADER_TITLE_MY_ACCOUNT)'</a>&nbsp;&nbsp;<a href="'tep_href_link(FILENAME_SHOPPING_CART)'">'tep_image(DIR_WS_IMAGES'header_cart.gif', HEADER_TITLE_CART_CONTENTS)'</a>&nbsp;&nbsp;<a href="'tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')'">'tep_image(DIR_WS_IMAGES'header_checkout.gif', HEADER_TITLE_CHECKOUT)'</a>'; ?>&nbsp;&nbsp;</td>.

</tr>.

I also tried copying the ddheader.htm into the catalog/includes/ but then I have 2 versions floating around and the image paths are all screwy. Im not a php writer but Im trying to learn..

Can I use.

Require(DIR_WS_something'ddheader.htm').

And then define the path somewhere?.

This post has been edited by.

Kenspants.

: 23 February 2004, 00:06..

Comments (16)

I would like to know the answer too. Anyone here know what is the answer to that question. I'll do some research and get back to you if I got an good answer. You should email the people at iPage as they probably could help you..

Comment #1

Problem. That only partially works. I see do the HTML but all my (relative) image paths in the ddheader.htm are busted. So I get no images. It is looking for.

Http://www.domain.co...eader_r2_c1.gif.

And not.

Http://www.domain.co...eader_r2_c1.gif.

From the ddheader.htm's perspective, it's path is relative to my /catalog/includes/header.php..

This post has been edited by.

Kenspants.

: 23 February 2004, 00:33..

Comment #2

Try the entire path:.

<?php include('path/to/your/actual/header/file.html');?>.

This post has been edited by.

Ptrau.

: 23 February 2004, 00:56..

Comment #3

That results in the same problem. The HTML file still comes up but the image files don't load cuz of the base reference. I was hoping some PHP genius knew a way around this dilemma..

This post has been edited by.

Kenspants.

: 23 February 2004, 05:16..

Comment #4

I don't think that it is a real PHP problem, but rather an HTML coding problem!.

You have to see the matter from the perspective of your php script! By including a file (which is in the root directory) in to your script (which 'physically' is in /catalog), it is as if the file in question was also in the /catalog directory! That's why it looks for the relative image path images in /root/catalog and not in /root! (It's not a technical explaination, but it behaves like that!).

Try changing the image path in the html file to ../images/filename, or use an absolute path!.

Antonios..

Comment #5

I want to pull my own header bar (called ddheader.htm which is in my iPage site root) into the catalog/includes/header.php..

How would I pull (using include or whatever) it in to the header.php and still keep all the paths working. I tried the code below but didn't work..

(Snipit from header.php near line 60).

<tr class="header">.

<td align="center" valign="middle"><?php include ('../../ddheader.htm'); ?></td>.

<td align="right" valign="bottom"><?php echo '<a href="'tep_href_link(FILENAME_ACCOUNT, '', 'SSL')'">'tep_image(DIR_WS_IMAGES'header_account.gif', HEADER_TITLE_MY_ACCOUNT)'</a>&nbsp;&nbsp;<a href="'tep_href_link(FILENAME_SHOPPING_CART)'">'tep_image(DIR_WS_IMAGES'header_cart.gif', HEADER_TITLE_CART_CONTENTS)'</a>&nbsp;&nbsp;<a href="'tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')'">'tep_image(DIR_WS_IMAGES'header_checkout.gif', HEADER_TITLE_CHECKOUT)'</a>'; ?>&nbsp;&nbsp;</td>.

</tr>.

I also tried copying the ddheader.htm into the catalog/includes/ but then I have 2 versions floating around and the image paths are all screwy. Im not a php writer but Im trying to learn..

Can I use.

Require(DIR_WS_something'ddheader.htm').

And then define the path somewhere?.

This post has been edited by.

Kenspants.

: 23 February 2004, 00:06..

Comment #6

Try the includes stuff again as if header.php was in the /catalog directory, so your includes statement would be like.

<?php include ('../ddheader.htm');  ?>.

Antonios.

This post has been edited by.

Detsouvalas.

: 23 February 2004, 00:11..

Comment #7


This question was taken from a support group/message board and re-posted here so others can learn from it.