Dynadot โ€” .com Registration $8.99

Help needed, possibly with ASP.

Spaceship Spaceship
Watch

dan_Vt

Established Member
Impact
13
I have a site with a number of pages, and want to sell a banner ad on each page (not separately, just one package deal). Instead of having to go through and update each page every time I sell the space, I would like to have code on the pages that pulls the ad (the image, url to link to, alt tag, title tag) from another file. I don't want to use an iframe because that would lessen the value of the banner because it wouldn't look like a link to the search engines, and iframes aren't great for SEO anyway.

I think the above can be done with ASP, but I'm not sure how.

Rep for the one who can solve my problem.

Update:

Would an Ajax include script do this? I know it would load the info, but would also have to appear like it's actually on the page it is being loaded to by the search engines.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
dan_Vt said:
I have a site with a number of pages, and want to sell a banner ad on each page (not separately, just one package deal). Instead of having to go through and update each page every time I sell the space, I would like to have code on the pages that pulls the ad (the image, url to link to, alt tag, title tag) from another file. I don't want to use an iframe because that would lessen the value of the banner because it wouldn't look like a link to the search engines, and iframes aren't great for SEO anyway.

I think the above can be done with ASP, but I'm not sure how.

Rep for the one who can solve my problem.

Update:

Would an Ajax include script do this? I know it would load the info, but would also have to appear like it's actually on the page it is being loaded to by the search engines.

There is no such thing as a ajax include, ajax is simply javascript which will make a "on the wall" request to a server side page.

Anyway, all you want here is a simple php include, asp will also do this but php is more widely supported.

PHP:
<?php
include 'file.extension';
?>

Hope that helps.

Matt
 
Last edited:
1
•••
Matt,

Awesome, and this will make the link appear as if it is on the page to the engines?

-- rep on its way.

D
 
0
•••
dan_Vt said:
Matt,

Awesome, and this will make the link appear as if it is on the page to the engines?

-- rep on its way.

D

No adverse SEO effects what so ever. PHP is serverside therefore the included file is physically included where you select it to be before any output is made to the client.

Thanks for the rep btw :tu:

edit: Remember your file needs to be a *.php or you need to add a .htaccess rule to allow php to parse in *.htm(l) files.

Matt
 
0
•••
The files already are php, so that's good.

One last question (though that's not a promise): I want to have the file that is pulled be only the size of the image (so 468x60). How do I get it to show appropriately like that?
 
0
•••
dan_Vt said:
The files already are php, so that's good.

One last question (though that's not a promise): I want to have the file that is pulled be only the size of the image (so 468x60). How do I get it to show appropriately like that?

The file will not technically be pulled like an iframe will, the file will be included into the file your include function is in. So a file with this in:

PHP:
<strong>Hello <?php include 'file.php'; ?></strong>

Assuming "file.php" contains:
PHP:
<em>Maverick</em>

Will become:
HTML:
<strong>Hello <em>Maverick</em></strong>

Before the page's client side code outputted so to speak. So if your included page simply contains an IMG tag with the banner in, it will have the same affect as adding the IMG code into the first page (which will now contain the include function).

Hope that make sense, if it doesn't, since its sometimes hard to get things from explanations then give it a try :tu:

Matt
 
0
•••
Well, it makes sense but I'm getting an error:

Warning: include(/ad.txt) [function.include]: failed to open stream: No such file or directory in /home/encentra/public_html/hosting-guide.php on line 19

Any thoughts?
 
0
•••
The error means what it says :p

Warning: include(/ad.txt) [function.include]: failed to open stream: No such file or directory in /home/encentra/public_html/hosting-guide.php on line 19

Remember that by adding the "/" to the start of the path you are making the path absolute, so it will be trying to find the file in the top most directory. If it is in the same folder, try removing the forward slash :)

Matt
 
0
•••
Matthew. said:
The error means what it says :p



Remember that by adding the "/" to the start of the path you are making the path absolute, so it will be trying to find the file in the top most directory. If it is in the same folder, try removing the forward slash :)

Matt

Yeah, I put it there so I can just copy it to other files that may be in other directories, but the file is a the top directory. I took out the slash and it works fine. I wonder why it didn't with the slash when that's where the file is...oh well.

Thanks again for your help.
 
0
•••
It didn't work because you were trying to open /ad.txt instead of /home/encentra/public_html/ad.txt :p
 
1
•••
Jim_ said:
It didn't work because you were trying to open /ad.txt instead of /home/encentra/public_html/ad.txt :p
:p right back at 'cha.










actually, thanks. I thought it would know the top was in public_html.
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back