Hello all, I am using this to include a page $homepage = "http://www.x.com/video_files.html"; $currentpage = $_SERVER['REQUEST_URI']; if($homepage==$currentpage) { include('ads.php'); 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 So, how can i still use include function. Thanks
Is the filename always going to be called video_files.html? If so, you can use $_SERVER['SCRIPT_NAME'] and use strpos() to check for video_files.html
Thanks DooBDee for the reply. Yes it will be always called video_files.html. First page is called http://www.x.com/video_files.html second page is http://www.x.com/2/video_files.html and so on. My php knowledge is not great. How can i use $_SERVER['SCRIPT_NAME'] on my code? Thanks
Try this code; $position = strpos($_SERVER['PHP_SELF'], 'video_files.html'); if ($position) { include('ads.php'); } PHP:
Weird. I just tested this snippet and it works here. Can you PM me or share the address of your site? Try REQUEST_URI instead of the above SCRIPT_URL or PHP_SELF.
Was just about to edit my post to suggest that one! REQUEST_URI should work ok. This was being used previously in your code anyway.
Thank god I am sorted. $currentpage = array_shift(explode('?', basename($_SERVER['REQUEST_URI']))); $page = "video_files.html"; if ($currentpage == $page) { include ('ads.php'); } PHP:
Dear how can we configure wamp or phptriad for mod_write. I have both of them Installed but they didn’t works… Can you tell me how can we configure it…
If you are using latest version of phptriad, it should work. You do not need to do anything. Just double check the httpd.conf file which is in AppServ\Apache2.2\conf Delete the ";" at the beginning of LoadModule rewrite_module modules/mod_rewrite.so Restart your apache and it should work.
I have # sign in the begininng of that... I have removed it but yet it did not working... Please tell me how can I check whether it is enabled or not....