GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   Some help with php (https://gfy.com/showthread.php?t=1093961)

camchoice 12-23-2012 09:52 AM

Some help with php
 
Hello ;

I am writing a piece of code to create cache files from a certain site and all its pages. Because we display different data from the database using server alias configuration we need to create cache files with http_host and request_uri combined. Otherwise displayed cached will be displayed on wrong sites. I already created a piece of code, but does not work properly ... Here is the part with the problem:

$filename = "cache/".basename(rtrim($_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"], '/')).".cache";

I would like the combine HTTP_HOST and REQUEST_URI into 1 filename, now it creates 2 files. 1 for index and 1 for every other page visited.

Thanks ;
Pascal

camchoice 12-23-2012 10:13 AM

Already found it ;)
$filename = "cache/".basename(rtrim($_SERVER["HTTP_HOST"], '/')).basename(rtrim($_SERVER["REQUEST_URI"], '/')).".cache";


All times are GMT -7. The time now is 11:00 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc