lJesterl Posted August 21, 2008 Share Posted August 21, 2008 This may be a silly question and not possible but im needing to achieve something and i think the best and easiest way would be if i could get the page name, i.e, main.php or testimonial.php and do something like if($pagename = main.php){ $code="0"; } if($pagename = testimonial.php{ $code="1"; } possible? Quote Link to comment https://forums.phpfreaks.com/topic/120720-page-name-question/ Share on other sites More sharing options...
Lamez Posted August 21, 2008 Share Posted August 21, 2008 I do not get what you want to do!? Quote Link to comment https://forums.phpfreaks.com/topic/120720-page-name-question/#findComment-622063 Share on other sites More sharing options...
trq Posted August 21, 2008 Share Posted August 21, 2008 if ($_SERVER['SCRIPT_FILENAME'] == 'main.php') { $code = 0; } elseif ($_SERVER['SCRIPT_FILENAME'] == 'testimonial.php') { $code = 1; } Quote Link to comment https://forums.phpfreaks.com/topic/120720-page-name-question/#findComment-622068 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.