javascript - How can Set session message from cakephp .ctp file -


Hello, I have a button on a watch page for which I have to check that we have to click on that button There is a different type of user on our site so that we do not want to allow users to click on it or make any changes to it, so that we are checking when clicking on that button, What we want is the sub Ogkrta or that we do not want to do, I'm checking the session ID button. So now what do I want to do if a user who we do not want to click on that button should take them to a thank you page with the message of the session How do I show a session message from the KPP controller about this I know:

  ** $ send = SITE_URL. "Thank you"; $ This- & gt; Session-> Set Flash (__ ("Sorry, you are an unauthorized user, contact us at help@example.com", true), 'default', array ('class' => 'notclass')); Echo "& lt; script type = 'text / javascript' & gt; window.location.href = ''. $ Sending. ''; & Lt; / script & gt;"; Die; **   

But when I am trying to do the same logic in the .cp file after my status if ($ this-> session-> gt; read ( 'AUTH.User .ID')! = '' & Amp; $ this- & gt; Session-> Read ('Auth.User.role_id') == '2') {

  Set Flash (__ ("Sorry, you are an unauthorized user, contact us at help@example.com", true), 'default', array ('class' => 'notclass')); Echo "

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -