NotSureILikePHP Posted August 6, 2015 Share Posted August 6, 2015 I have a span that is only supposed to show if the user is an admin. The code works fine on the current system but I'm trying to upgrade to a newer system. Here is the code: <div class="note ui-corner-top"> <h4 class="ui-corner-top"> <?=Format::daydatetime($note[created])?> - posted by <?=$note[staff]?> <span id='link_<?=$note[noteID]?>' style='float:right;padding-right:10px;'> <span id='sEdit'><a href='javascript:makeEditable("<?=$note[noteID]?>", "Edit", "customer_note")'>Edit</a></span> <?if($thisstaff->isAdmin()){?> <span id='sDelete'> \ <a href='javascript:makeEditable("<?=$note[noteID]?>", "Delete", "customer_note")'>Delete</a></span> <?}?> <span id='customer_note_save_link_<?=$note[noteID]?>' style='display:none'><a href='javascript:makeEditable("<?=$note[noteID]?>", "Save", "customer_note")'>Save</a></span> <span id='customer_note_cancel_link_<?=$note[noteID]?>' style='display:none'> \ <a href='javascript:makeEditable("<?=$note[noteID]?>", "Cancel", "customer_note")'>Cancel</a> < /span> </span> </h4></div>[/] This is displaying "Edit isAdmin()){?> \ Delete" When I delete this line of code: [code]<?if($thisstaff->isAdmin()){?>[/] I get "Edit / Delete" which is exactly what I want but then it always displays even when the user isn't an admin. I'm assuming I'm missing something very simple here, like an apostrophe or something but I can't figure it out. Quote Link to comment Share on other sites More sharing options...
NomadicJosh Posted August 6, 2015 Share Posted August 6, 2015 Can you also post the code that is doing the admin check? Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted August 7, 2015 Share Posted August 7, 2015 You getting that output because most likely your "newer system" does not have a setting call short_open_tags enabled for your php config. Either enable that setting or covert the short php tags such as <? ?> to be the full php tag syntax <?php ?> Quote Link to comment 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.