Monday 18 April 2022

How to disable phpinfo() in a hosting environment?

Login to server WHM as a root user

Edit the php.ini file. Add below line

disable_functions = phpinfo

Restart the server

Friday 15 April 2022

Fatal error: Cannot pass parameter by reference in PHP

Fatal error: Cannot pass parameter  by reference in PHP.

$stmt->bind_param("ssss",$userid,$theme,$title,"test");

The error is with 'test' in the bind_param call.

All parameters to bind_param must be passed by reference. A string is a primitive value, and cannot be passed by reference.

You can fix this by creating a variable and passing that as a parameter instead:

$testvar="test";

$stmt->bind_param("ssss",$userid,$theme,$title,$testvar);

Enable or disable the "Powered by TinyMCE" branding.

Tinymce branding property allow you to enable or disable the "Powered by TinyMCE" branding.

tinymce.init({
  selector: 'textarea',  
  branding: false
});

Thursday 14 November 2019

Adding Excel export button hides/removes the Page Length Dropdown in Data Tables

Add below line in javascript table initialization

"dom": '<"top"Bf>rt<"bottom"lip><"clear">'

Complete Code 
<script>
        $(document).ready(function () {       
        $('#example').DataTable( {
                "processing": true,               
                "lengthMenu": [[25, 50, -1], [ 25, 50, "All"]],
                "dom": '<"top"Bf>rt<"bottom"lip><"clear">',
                "serverSide": true,
                "ajax": "server_processing.php"
            } );
        });                     

</script>