NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page include function with mode rewrite?

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-07-2007, 12:44 PM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Jan 2007
Posts: 98
baris22 is an unknown quantity at this point
 



include function with mode rewrite?


Hello all,

I am using this to include a page
Code:
$homepage = "http://www.x.com/video_files.html";
$currentpage = $_SERVER['REQUEST_URI'];  
if($homepage==$currentpage) {
include('ads.php');
I started using mode rewrite. When I go to the second page my url changes to http://www.x.com/2/video_files.html

????: NamePros.com http://www.namepros.com/programming/393264-include-function-with-mode-rewrite.html
So, how can i still use include function.

Thanks
baris22 is offline  
Old 11-07-2007, 01:44 PM   #2 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund
Your method of doing it isn't pretty. But if you would want to expand this method...

PHP Code:
<?php
????: NamePros.com http://www.namepros.com/showthread.php?t=393264

$currentpage 
$_SERVER['REQUEST_URI'];

$homepage = array
                (
                
"/test/showadsperpage.php",
                
"/some_other_page.html",
                );


foreach (
$homepage as $name)
                if (
$currentpage == $name)
                {
                                include (
'ads.php');
                                break;
                }                
?>
Daniel is offline  
Old 11-07-2007, 01:54 PM THREAD STARTER               #3 (permalink)
NamePros Member
Join Date: Jan 2007
Posts: 98
baris22 is an unknown quantity at this point
 



I must have over 500 pages for video_files.html

My page listings are like this

http://www.x.com/video_files.html
http://www.x.com/1/video_files.html
http://www.x.com/2/video_files.html
http://www.x.com/3/video_files.html
http://www.x.com/4/video_files.html
...

I do not think it will be a good idea to list all the urls.

is there any other way.

Thanks



Originally Posted by Danltn
Your method of doing it isn't pretty. But if you would want to expand this method...

PHP Code:
<?php

$currentpage 
$_SERVER['REQUEST_URI'];

$homepage = array
                (
                
"/test/showadsperpage.php",
                
"/some_other_page.html",
                );
????: NamePros.com http://www.namepros.com/showthread.php?t=393264


foreach (
$homepage as $name)
????: NamePros.com http://www.namepros.com/showthread.php?t=393264
                if (
$currentpage == $name)
                {
                                include (
'ads.php');
                                break;
                }                
?>
baris22 is offline  
Old 11-07-2007, 02:08 PM   #4 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund
PHP Code:
  <?php

$currentpage 
array_shift(explode('?'basename($_SERVER['REQUEST_URI'])));

$page "video_files.html";

if (
$currentpage == $page)
{
                include (
'ads.php');
????: NamePros.com http://www.namepros.com/showthread.php?t=393264
}
?>
Daniel is offline  
Old 11-07-2007, 02:17 PM THREAD STARTER               #5 (permalink)
NamePros Member
Join Date: Jan 2007
Posts: 98
baris22 is an unknown quantity at this point
 



Originally Posted by Danltn
PHP Code:
  <?php
????: NamePros.com http://www.namepros.com/showthread.php?t=393264

$currentpage 
array_shift(explode('?'basename($_SERVER['REQUEST_URI'])));

$page "video_files.html";

if (
$currentpage == $page)
{
                include (
'ads.php');
}
?>

Waw thank you very much.

it worked.

I wile check my paypal, if i have got anything i will try to donate.

Thanks again
baris22 is offline  
Closed Thread


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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:08 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger