[advanced search]
Results from the most recent live auction are here.
29 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming > CODE
User Name
Password

Old 06-16-2005, 11:50 PM   · #1
BLazeD
thedomainmatrix.com
 
BLazeD's Avatar
 
Name: Matt
Location: New Zealand
Trader Rating: (40)
Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 (Donate)
BLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to all
Lightbulb Real Easy PHP/Java Query

I have a site, eg www.house.com

I want one ad to show on every single page, except any page that has www.house.com/forum* in the URL.

For the pages that have www.house.com/forum* in the URL I want to show another ad.

I guess either javascript or PHP could do this.

eg.

Define URL

IF URL=www.house.com/forum*

Then

Display AD2

ELSE

Display AD1

I know how it should work, just not the actual code.

Help much appreciated!!!!

PS: Any questions about what I have said please ask, I really need this help


Please register or log-in into NamePros to hide ads
BLazeD is offline   Reply With Quote
Old 06-17-2005, 12:50 AM   · #2
dgaussin
Apprentice Domainer
 
dgaussin's Avatar
 
Name: David
Location: France
Trader Rating: (81)
Join Date: May 2004
Posts: 1,297
NP$: 79.35 (Donate)
dgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to behold
Matt, you could try something like that in PHP.

PHP Code:
<? if (eregi('www.house.com/forum', $_SERVER['HTTP_HOST'].'/'.$_SERVER['PHP_SELF'])) { ?>
Display AD2
<? } else { ?>
Display AD1
<? } ?>

Use HTML code for display Ad2 and Ad1.

Hope that works since I didn't test
dgaussin is offline   Reply With Quote
Old 06-17-2005, 01:04 AM   · #3
BLazeD
thedomainmatrix.com
 
BLazeD's Avatar
 
Name: Matt
Location: New Zealand
Trader Rating: (40)
Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 (Donate)
BLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to all
Hey man, thanks for that, but it only shows the AD1 (also shows AD1 where AD2 should be displayed)

I cant get it to show AD2
BLazeD is offline   Reply With Quote
Old 06-17-2005, 01:18 AM   · #4
dgaussin
Apprentice Domainer
 
dgaussin's Avatar
 
Name: David
Location: France
Trader Rating: (81)
Join Date: May 2004
Posts: 1,297
NP$: 79.35 (Donate)
dgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to behold
Oops, sorry, did a little mistake

PHP Code:
<? if (eregi('www.house.com/forum', $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'])) { ?>
pub 1    
<? } else { ?>
pub 2
<? } ?>

I tested and it works...

Next time, I test before to post code
dgaussin is offline   Reply With Quote
Old 06-17-2005, 01:30 AM   · #5
BLazeD
thedomainmatrix.com
 
BLazeD's Avatar
 
Name: Matt
Location: New Zealand
Trader Rating: (40)
Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 (Donate)
BLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to all
Thanks so much - works perfectly!!!
BLazeD is offline   Reply With Quote
Old 07-13-2005, 12:39 AM   · #6
BLazeD
thedomainmatrix.com
 
BLazeD's Avatar
 
Name: Matt
Location: New Zealand
Trader Rating: (40)
Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 (Donate)
BLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to all
Any idea how to change the PHP version of this code, to include multiple URLs?

ie. abc.com/a.php and abc.com/b.php it doesnt display

But for any other abc.com address it will display?

Cheers
BLazeD is offline   Reply With Quote
Old 07-13-2005, 01:13 AM   · #7
dgaussin
Apprentice Domainer
 
dgaussin's Avatar
 
Name: David
Location: France
Trader Rating: (81)
Join Date: May 2004
Posts: 1,297
NP$: 79.35 (Donate)
dgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to behold
Try something like :
Code:
<?if (eregi('www.abc.com/a.php|www.abc.com/b.php', $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'])) { ?> pub 1 <? } else { ?> pub 2 <? } ?>
dgaussin is offline   Reply With Quote
Old 07-13-2005, 02:24 AM   · #8
Crabby
NamePros Member
 
Trader Rating: (0)
Join Date: Aug 2004
Posts: 70
NP$: 50.00 (Donate)
Crabby is an unknown quantity at this point
PHP Code:
<?php
$urls
[] = 'www.house.com/forum';
$urls[] = 'www.house.com/a.php';
$urls[] = 'www.house.com/b.php';
// etc...
if (eregi($urls, $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) { ?>
pub 1     
<?php } else { ?>
pub 2
<?php } ?>
__________________
michael.Crabbe
www.arcadexl.com
Crabby is offline   Reply With Quote
Old 07-13-2005, 03:18 AM   · #9
BLazeD
thedomainmatrix.com
 
BLazeD's Avatar
 
Name: Matt
Location: New Zealand
Trader Rating: (40)
Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 (Donate)
BLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to allBLazeD is a name known to all
Cheers all

I am trying to setup GoogleAds in my VB forums, but you cant have it on search results etc, so I am trying to get a script to stop it appearing on those pages.

VB keeps rejecting the code though.
BLazeD is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 Flash Designs - Easy Edittable - [$40] - ALL rights boost Web Development Wanted 4 04-19-2005 08:28 PM
EasyJobs.info 1039 searches in Overture in March 2005. greatwebss Domain Appraisals 3 04-19-2005 06:54 PM
BeachRealEstate.biz wot Domain Appraisals 3 01-12-2005 08:51 PM
I have my own lake :P Nunim The Break Room 1 12-31-2004 08:42 PM
Rare & Real 6.95 Enom Reseller Account with FREE DOMAIN! tekz999 For Sale / Advertising Board 0 04-09-2004 01:44 AM

Site Sponsors
Special Offer Buy Flash Arcade Game Script http://www.mobisitetrader.com/
Advertise your business at NamePros
All times are GMT -7. The time now is 04:41 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0