Jump to content

Php in index template file


Guest bluecure

Recommended Posts

Guest bluecure

Hi,

Firstly I realize this topic has been brought up before http://forums.cubecart.com/index.php?showtopic=33226 , I just wasn't sure if I should resurrect an old thread or start a new on.

Anywho, If anyone can help me with this issue I'd greatly appreciate it.

I need to add some php code into the main index tpl file for the site. To attempt this I have referred to the variable I need in the tpl file like so {variablename} and then placed my php code in the includes/global/index.inc.php file. To be honest I have no idea if this is the write file to put my code in or not. I've tested the php code I'm using outside of cube cart and it works perfectly fine, but I can't get the php variable to be placed in the tpl file where {variablename} is.

The php code is

<?php

$variablename = end(explode('/', $_SERVER['PHP_SELF']));



if($variablename == 'digital-test2.php') {

	$variablename = '<li class="active">';

}

else {

	$variablename = '<li>';

} 

?>

I've tried following the messages in the topic linked to above but without success, Any guidance would be great,

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...