-2
    $content .= '</td><td style=" text-align:left !important;"><p>' 
. $boardCodeAndName[$room['BoardOption']] . '</p></td><td><b>&pound;' 
. round($cost_per_person) . '</b></td><td><input onClick="avg_value(' 
. $final_hotel_count . ',' . $cost_per_person 
. ');" type="radio" name="hotel_' . $final_hotel_count 
. $final_room_count . '" class="hotel_' . $final_hotel_count 

this is my code how to hide this when i am inspecting.

  • 5
    1) Show us what you tried; 2) Please edit your code so it looks like code. – thxou Sep 06 '17 at 06:33
  • Possible duplicate of [How to hide form code from view code/inspect element browser?](https://stackoverflow.com/questions/24319786/how-to-hide-form-code-from-view-code-inspect-element-browser) – Ananthakrishnan Baji Sep 06 '17 at 06:36
  • First of all think that is it possible ? Is without any HTML any web page can work? – Mayank Vadiya Sep 06 '17 at 06:41
  • Do you mean that the code is inspected in Codeigniter or simply that the site is made _using_ Codeigniter? Hiding it from browsers inspect-view isn't possible. – M. Eriksson Sep 06 '17 at 06:49
  • You kind of need to answer peoples questions if you're expecting them to help you – M. Eriksson Sep 06 '17 at 07:03

2 Answers2

2

How to hide HTML code when inspecting?

This given option will disable the inspecting on the page.

  1. Script for disable the Right click on the page:

    <script type="text/javascript">
        $(document).bind("contextmenu",function(e) {
            e.preventDefault();
        });
    </script>
    
  2. Enable the key F12 from the keyboard to open inspect.

    <script type="text/javascript">
         $(document).keydown(function(e){
            if(e.which === 123){
               return false;
            }
        });
    </script>
    

this code will work in Codeigniter. Just put it inside <script> tag and put that at the end of your page.

Community
  • 1
  • 1
always-a-learner
  • 3,671
  • 10
  • 41
  • 81
1
<script type="text/javascript">
    document.onkeydown = function(e) {
if(event.keyCode == 123) {
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)){
return false;
}

}