[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 02-24-2007, 07:02 AM   #1 (permalink)
Senior Member
 
Join Date: Dec 2004
Location: Burlington, Vermont
Posts: 1,043
1,086.90 NP$ (Donate)

dan_Vt is a jewel in the roughdan_Vt is a jewel in the roughdan_Vt is a jewel in the rough


Help needed, possibly with ASP.

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.
__________________
Vermont SEO
Automotive SEO

For Sale: Co-Sign.com | Skiny.net | CSIFAQ.com | FuelBank.net | Jibbar.com |
dan_Vt is offline  
Old 02-24-2007, 07:38 AM   #2 (permalink)
Stud Sausage
 
Join Date: Dec 2006
Location: England
Posts: 1,546
34.41 NP$ (Donate)

Matthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud of

Adoption Breast Cancer Breast Cancer Cancer Survivorship
Quote:
Originally Posted by dan_Vt
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 Code:
<?php
include 'file.extension';
?>
Hope that helps.

Matt
__________________
My NamePros Tools
(firefox plugin, google gadget etc)

Last edited by Matthew.; 02-24-2007 at 07:48 AM.
Matthew. is offline  
Old 02-24-2007, 07:44 AM   #3 (permalink)
Senior Member
 
Join Date: Dec 2004
Location: Burlington, Vermont
Posts: 1,043
1,086.90 NP$ (Donate)

dan_Vt is a jewel in the roughdan_Vt is a jewel in the roughdan_Vt is a jewel in the rough


Matt,

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

-- rep on its way.

D
__________________
Vermont SEO
Automotive SEO

For Sale: Co-Sign.com | Skiny.net | CSIFAQ.com | FuelBank.net | Jibbar.com |
dan_Vt is offline  
Old 02-24-2007, 07:48 AM   #4 (permalink)
Stud Sausage
 
Join Date: Dec 2006
Location: England
Posts: 1,546
34.41 NP$ (Donate)

Matthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud of

Adoption Breast Cancer Breast Cancer Cancer Survivorship
Quote:
Originally Posted by dan_Vt
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

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
__________________
My NamePros Tools
(firefox plugin, google gadget etc)
Matthew. is offline  
Old 02-24-2007, 07:51 AM   #5 (permalink)
Senior Member
 
Join Date: Dec 2004
Location: Burlington, Vermont
Posts: 1,043
1,086.90 NP$ (Donate)

dan_Vt is a jewel in the roughdan_Vt is a jewel in the roughdan_Vt is a jewel in the rough


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?
__________________
Vermont SEO
Automotive SEO

For Sale: Co-Sign.com | Skiny.net | CSIFAQ.com | FuelBank.net | Jibbar.com |
dan_Vt is offline  
Old 02-24-2007, 07:56 AM   #6 (permalink)
Stud Sausage
 
Join Date: Dec 2006
Location: England
Posts: 1,546
34.41 NP$ (Donate)

Matthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud of

Adoption Breast Cancer Breast Cancer Cancer Survivorship
Quote:
Originally Posted by dan_Vt
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 Code:
<strong>Hello <?php include 'file.php'; ?></strong>
Assuming "file.php" contains:
PHP Code:
<em>Maverick</em>
Will become:
HTML Code:
<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

Matt
__________________
My NamePros Tools
(firefox plugin, google gadget etc)
Matthew. is offline  
Old 02-24-2007, 08:02 AM   #7 (permalink)
Senior Member
 
Join Date: Dec 2004
Location: Burlington, Vermont
Posts: 1,043
1,086.90 NP$ (Donate)

dan_Vt is a jewel in the roughdan_Vt is a jewel in the roughdan_Vt is a jewel in the rough


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?
__________________
Vermont SEO
Automotive SEO

For Sale: Co-Sign.com | Skiny.net | CSIFAQ.com | FuelBank.net | Jibbar.com |
dan_Vt is offline  
Old 02-24-2007, 08:04 AM   #8 (permalink)
Stud Sausage
 
Join Date: Dec 2006
Location: England
Posts: 1,546
34.41 NP$ (Donate)

Matthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud of

Adoption Breast Cancer Breast Cancer Cancer Survivorship
The error means what it says

Quote:
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
__________________
My NamePros Tools
(firefox plugin, google gadget etc)
Matthew. is offline  
Old 02-24-2007, 08:10 AM   #9 (permalink)
Senior Member
 
Join Date: Dec 2004
Location: Burlington, Vermont
Posts: 1,043
1,086.90 NP$ (Donate)

dan_Vt is a jewel in the roughdan_Vt is a jewel in the roughdan_Vt is a jewel in the rough


Quote:
Originally Posted by Matthew.
The error means what it says



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.
__________________
Vermont SEO
Automotive SEO

For Sale: Co-Sign.com | Skiny.net | CSIFAQ.com | FuelBank.net | Jibbar.com |
dan_Vt is offline  
Old 02-24-2007, 09:49 AM   #10 (permalink)
NamePros Regular
 
Jim_'s Avatar
 
Join Date: Aug 2005
Posts: 585
285.40 NP$ (Donate)

Jim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to all

Save The Children
It didn't work because you were trying to open /ad.txt instead of /home/encentra/public_html/ad.txt
__________________
ask me about the internet
Jim_ is offline  
Old 02-24-2007, 02:39 PM   #11 (permalink)
Senior Member
 
Join Date: Dec 2004
Location: Burlington, Vermont
Posts: 1,043
1,086.90 NP$ (Donate)

dan_Vt is a jewel in the roughdan_Vt is a jewel in the roughdan_Vt is a jewel in the rough


Quote:
Originally Posted by Jim_
It didn't work because you were trying to open /ad.txt instead of /home/encentra/public_html/ad.txt
right back at 'cha.










actually, thanks. I thought it would know the top was in public_html.
__________________
Vermont SEO
Automotive SEO

For Sale: Co-Sign.com | Skiny.net | CSIFAQ.com | FuelBank.net | Jibbar.com |
dan_Vt is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:39 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85