 |
Results from the most recent live auction are here.
29 members in the live chat room. Join Chat!
| |
06-16-2005, 11:50 PM
|
· #1 | | thedomainmatrix.com Name: Matt Location: New Zealand Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 ( Donate)
| 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  |
| |
06-17-2005, 12:50 AM
|
· #2 | | Apprentice Domainer Name: David Location: France Join Date: May 2004
Posts: 1,297
NP$: 79.35 ( Donate)
| 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  |
| |
06-17-2005, 01:04 AM
|
· #3 | | thedomainmatrix.com Name: Matt Location: New Zealand Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 ( Donate)
| 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 |
| |
06-17-2005, 01:18 AM
|
· #4 | | Apprentice Domainer Name: David Location: France Join Date: May 2004
Posts: 1,297
NP$: 79.35 ( Donate)
| 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  |
| |
06-17-2005, 01:30 AM
|
· #5 | | thedomainmatrix.com Name: Matt Location: New Zealand Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 ( Donate)
| Thanks so much - works perfectly!!! |
| |
07-13-2005, 12:39 AM
|
· #6 | | thedomainmatrix.com Name: Matt Location: New Zealand Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 ( Donate)
| 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 |
| |
07-13-2005, 01:13 AM
|
· #7 | | Apprentice Domainer Name: David Location: France Join Date: May 2004
Posts: 1,297
NP$: 79.35 ( Donate)
| 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
<? } ?> |
| |
07-13-2005, 02:24 AM
|
· #8 | | NamePros Member | 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 } ?> |
| |
07-13-2005, 03:18 AM
|
· #9 | | thedomainmatrix.com Name: Matt Location: New Zealand Join Date: Apr 2004
Posts: 1,462
NP$: 311.00 ( Donate)
| 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. |
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |