Adding PHP script to an individual page

Feel free to talk about everything related to our Joomla Products
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Fri Jul 27, 2012 10:55 pm
Hey guys,

I need to add a PHP script to my homepage in order to detect the browser and direct the mobile users to the mobile website written in jQuery. The PHP code also includes a cookie option so the users will be able to switch back to the full website without getting stuck in redirect loop. The code works fine but I only need it on the homepage and not on the other pages. I add this script to the top of the default.php page on the template. It doesn't have to be on the header section (<head>) to work. is there anyway to add this code to an individual page (in my case homepage) but not all the other pages?

Thanks,
SH
User avatar
Junior Boarder

GK User
Sat Jul 28, 2012 9:48 pm
In Joomla there is no option to set PHP script to individual pages, you can try to modify the framework code in part where we detect browser and redirect user to specified page. It is probably much easier to redirect via JavaScript not by PHP code.
User avatar
Platinum Boarder


cron