Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Thread Tools Display Modes
Share |
Old 05-16-2015, 10:40 AM
basketmen basketmen is offline
Contributing Member
Join Date: 03-21-07
Posts: 97
iTrader: 0 / 0%
[PHP] What if conditional methode to do this? please help

i have responsive template, its have 3 php files :

- templatedesktop.php : template file for desktop

- templatemobile.php : template file for mobile

- page.php : contain information content, its included templatedesktop.php & templatemobile.php file inside

now i need to hide some part inside page.php, that should hide from mobile version, and appeared in desktop version only

i already tried add this define code inside templatedesktop.php file :
define('THIS_SCRIPT', 'templatedesktop');
and wrap some part that want to hide
if (THIS_SCRIPT == 'templatedesktop')
some part that want to hide
but its not working, maybe its should do the opposite, please help what is the right if conditional/methode? like request, referer or other
Reply With Quote



Old 05-16-2015, 01:12 PM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,025
iTrader: 4 / 100%
At what point in which script is the determination made for which template file to use?

I think that is where the coding needs to be done. Even though the template files end in .php they are simply includes to the main script that is running.
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No more conditional comments in IE10 HTMLBasicTutor Coding Forum 1 10-28-2011 01:41 AM
WTS:Special 4Noobs Easy Methode 1.50-2.50 Dailly Doffolow The Webmaster Marketplace 0 04-05-2010 04:32 AM
Conditional Stylesheet Not Working Foppa Coding Forum 4 03-22-2010 12:57 AM
PHP conditional statements help Kream Coding Forum 14 03-06-2009 12:29 PM
IE Conditional Comments StarLab Coding Forum 2 07-30-2008 06:31 AM

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 09:57 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC