Trek15 Posted April 8, 2009 Share Posted April 8, 2009 Hello. This is the first time i've visited a PHP community so bare with me... I've got an HTML document with an iframe covering the page and a strip of buttons at the top that changes content in this frame. What i would like to do is to make it so that only visitors who have registered and currently are logged in to the SMF 2 forum, situated one folder down from the position of the HTML document on the server, can see certain ones of those buttons. This would ideally mean that when users back to the site they would see these buttons right away thanks to cookies. This is what i've gotten help with and done so far: Added <?php require("PATH/SSI.php") ?> into the first line of the HTML document. And // Just return the user name function ssi_getuser() { global $context; if ($context['user']['is_guest']) return "Guest"; else return $context['user']['name']; } // Is the user logged in? function ssi_getlogin() { global $context; if ($context['user']['is_guest']) return false; else return true; } to an appropriate place within SSI.php. What i'm apparently supposed to do now is to set up a script around the HTML that i want to make conditional and "echo" the HTML statements if the condition is true. I'm pretty sure that doing this is rather basic PHP, but i'm too scared to screw something up doing it myself, so i would appreciate if someone else could help me with this. Thanks! Link to comment https://forums.phpfreaks.com/topic/153182-make-html-pages-aware-of-logged-in-smf-users-and-control-elements-on-them/ Share on other sites More sharing options...
Trek15 Posted April 8, 2009 Author Share Posted April 8, 2009 bump Link to comment https://forums.phpfreaks.com/topic/153182-make-html-pages-aware-of-logged-in-smf-users-and-control-elements-on-them/#findComment-804802 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.