How do I have a table cell fetch another page to display within the cell?

  • Thread starter Phillip Roncoroni
  • Start date
P

Phillip Roncoroni

I'm testing out an Google AdSense, and I'd like to have the following:

- A two column, one row table
- Left cell, 100% size, top justified, with the page content
- Right cell, top justified, displaying the ad code

Now, since my site is almost entirely static, I don't want to have to
re-edit all my pages again in the future if the ad program code changes, or
if I decide to opt out.

I want the ad code in a file like adcode.htm, and I want the right cell to
fetch that page and display it everytime.

How do I go about doing this?

Thanks in advance.
 
D

David Dorward

Phillip said:
I'm testing out an Google AdSense, and I'd like to have the following:

- A two column, one row table
- Left cell, 100% size, top justified, with the page content
- Right cell, top justified, displaying the ad code
http://www.allmyfaqs.com/faq.pl?Tableless_layouts

Now, since my site is almost entirely static, I don't want to have to
re-edit all my pages again in the future if the ad program code changes,
or if I decide to opt out.

http://www.allmyfaqs.com/faq.pl?Include_one_file_in_another
 
D

Dennis M. Marks

Phillip Roncoroni said:
I'm testing out an Google AdSense, and I'd like to have the following:

- A two column, one row table
- Left cell, 100% size, top justified, with the page content
- Right cell, top justified, displaying the ad code

Now, since my site is almost entirely static, I don't want to have to
re-edit all my pages again in the future if the ad program code changes, or
if I decide to opt out.

I want the ad code in a file like adcode.htm, and I want the right cell to
fetch that page and display it everytime.

How do I go about doing this?

Thanks in advance.

If you must stay with a table look up using an iframe. It's easy to use
but many people in this group don't like it.
<iframe src="xxx" style="xxx">no iframe message</iframe>
Put above in the table cell. Set its size, borders, scroll bars, etc.
using css.
 
P

Phillip Roncoroni

Dennis M. Marks said:
If you must stay with a table look up using an iframe. It's easy to use
but many people in this group don't like it.

Well I don't *have* to stay within a table, it's just that html isn't what I
do best, far from it, and I hate using Frontpage and Dreamweaver in the
first place. I just figured it'd be the easiest way to do it within
Frontpage, since that's what I use. Why don't people here like iFrames?
<iframe src="xxx" style="xxx">no iframe message</iframe>
Put above in the table cell. Set its size, borders, scroll bars, etc.
using css.

I tried using an iFrame, and my reslts are either:
a) A stupid box, with scrollbars and stuff
b) My page not showing up. I tell it no borders, no scrollbars, top
alignment, and I specify 100% size for the width and height, because I
assumed it would then shape itself to be only as large as the resulting
page, but since the resulting page is blank except for some JavaScript ad
code, it ends up not displaying, since it seems to shrink it down to 1x1 or
something.

Other things I've tried since posting my original inquiry here are:
<script language="javascript" src="adsense.js"></script>

This works for some people who tested it for me, but for me IE displays a
syntax error.

<? include "include.htm" ?>
That worked, but it'll require me to rename all my htm files to php, and
also edit all the htm links to php as well, which I don't want to do.
 
P

Phillip Roncoroni

Dennis M. Marks said:
If you must stay with a table look up using an iframe. It's easy to use
but many people in this group don't like it.
<iframe src="xxx" style="xxx">no iframe message</iframe>
Put above in the table cell. Set its size, borders, scroll bars, etc.
using css.

Here's an example:
http://www.goodcowfilms.com/inline.htm
This works, with a static width/height of the ads, and refers to another
iFrame, adsense.htm.

My reasoning behind trying this, was that I didn't want to put a static
value for the width/height, because that defeats the purpose of fetching a
page so I can change it in the future.

Since doing it with the 100% width/height didn't work, because the page was
technically blank, except for ad code, I thought maybe an iFrame linking to
an iFrame with a static width/height would work, that way I could change
iFrame1 easily in the future, and not be stuck with a static value. But it
doesn't work, it still shows up as white space, because I assume the 100%
value and no "visible" content is shrinking it down.

*a few minutes later*

After re-sizing iFrame1 to static values in FrontPage, to even see if the
iFrame in an iFrame theory would work, and it did, I set it back to 100%,
and now my idea about seems to be working, and without a static value, just
a 100% value. I guess I can chaulk that up to FrontPage being a piece of
crap?

I'll continue to mess around with this now, and probably break some
things...
 
P

Phillip Roncoroni

Keeper said:
one word... iframe

lol lots o luck
Later,
Keeper

But it's not working unless I give it a static width/height, which defeats
the point, because if I want to change it in the future, I have to change
the code on every single page then.
 
B

brucie

in post: <
Phillip Roncoroni said:
<? include "include.htm" ?>
That worked, but it'll require me to rename all my htm files to php,

no it wont
and also edit all the htm links to php as well,

no it wont
which I don't want to do.

you don't have to.

stop being sooo gowd damn negative. all you have to do is tell your
server that files with a .html extension are php (assuming you just
don't want to do a simple search and replace to change .html to .php)

stick the below in a .htaccess file[1] for the directory you want the
directives to apply to. child directories inherit the directives so if
you stick it in your root the directives will apply to all of your site.


AddType application/x-httpd-php .html


[1] a .htaccess file is a plain text file named as shown. if you create
the file with notepad save the file with quotes to prevent notepad from
adding a .txt extension i.e: ".htaccess"
 
P

Phillip Roncoroni

brucie said:
in post: <"Phillip Roncoroni" <[email protected]> said:

stick the below in a .htaccess file[1] for the directory you want the
directives to apply to. child directories inherit the directives so if
you stick it in your root the directives will apply to all of your site.


AddType application/x-httpd-php .html


[1] a .htaccess file is a plain text file named as shown. if you create
the file with notepad save the file with quotes to prevent notepad from
adding a .txt extension i.e: ".htaccess"

I wasn't being "negative," I asked my host if there was a way to make the
server run all html files as php, and the answer I got was no.

I'll try what you suggested though. Does this work on every Unix server, or
is it hit and miss?
 
K

Kris

Phillip Roncoroni said:
<? include "include.htm" ?>
That worked, but it'll require me to rename all my htm files to php, and
also edit all the htm links to php as well, which I don't want to do.

The importance of choosing extension-independant filenames:

instead of domain.com/contact.php or domain.com/contact.php, you use
domain.com/contact/

or changing your .htaccess file to parse .htm/.html files as PHP.
 
P

Phillip Roncoroni

brucie said:
in post: <


YAY! now move to a host that doesn't lie to you

Or maybe they just didn't know.

I think my host hires people who don't really know what they're doing for
the 24/7 live AIM support, but otherwise, I love my host. Blazing fast
speed, seemingly always up, and lots of features. They even recently
installed Fantastico on the cPanel, so I don't even have to manually install
modules now.

50GB transfer, 6GB space, $25 a month.

Granted, I usually go over 50GB transfer each month since my site is a
multimedia one, but I still like my host.
 
P

Phillip Roncoroni

Kris said:
The importance of choosing extension-independant filenames:

instead of domain.com/contact.php or domain.com/contact.php, you use
domain.com/contact/

So basically every link on every page should route to a directory with the
filename you wanted it to be, that way you have no extension problems in the
future? That seems rather messy, and unorganized.
or changing your .htaccess file to parse .htm/.html files as PHP.

Or that, thanks to brucie.
 
T

Toby A Inkster

Phillip said:
So basically every link on every page should route to a directory with the
filename you wanted it to be, that way you have no extension problems in the
future? That seems rather messy, and unorganized.

No. You can use the Apache MultiViews option instead.

That way, instead of pointing to:
http://www.goddamn.co.uk/tobyink/scratch/menu.html

I can point to:
http://www.goddamn.co.uk/tobyink/scratch/menu

and the same file will be loaded.

Then at a later date I can switch from a .html file to a .php file, or
..cgi or even .mp3, .jpeg or .avi if I wanted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top