This topic is locked
[SOLVED]

 Header on List Page only

2/6/2012 3:10:46 PM
PHPRunner General questions
S
scopley author

I'm currently using PHPRunner 6.0 and I would to add a header on just the list pages? Can this be done? Whenever I add my code to header file it adds it to all the pages.
Please advise.
Scopley <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=18976&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />

C
cgphp 2/6/2012

Enter the following code in the Header section:

<?php

if(basename($_SERVER['PHP_SELF']) == 'pagename_list.php')

{

//show the header

}

?>
S
scopley author 2/7/2012



Enter the following code in the Header section:

<?php

if(basename($_SERVER['PHP_SELF']) == 'pagename_list.php')

{

//show the header

}

?>



This works great if I know the exact filename. I want to be able to put the same header on all list pages. Is there anyway to have it look for 'list' within the filename have it put the header on just the list pages?
Thanks so much for your help.

C
cgphp 2/7/2012
<?php

$file_name = basename($_SERVER['PHP_SELF']);
if(substr($file_name, -9) == '_list.php')

{

//show the header

}

?>