Feeding Your Inner Developer

Category: PHP/JS/MySQL Scripting

How to sanitize GET and POST in PHP

There is actually a pretty simple solution for this one $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING); and $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);

How to solve inconsistent PHP times

Most likely, the issue is with your php server randomly choosing a timezone and therefore having times which are usually…

How to add and subtract fom time in MySQL

Luckily for us there is an ADDTIME function we can use to add and remove from times… The syntax is…

How to get mssql to work on php (debian/ubuntu)

Assuming that you already have PHP installed, you enter into theĀ console apt-get install php5-sybase (sadly not asĀ intuitive as apt-get install…

How to close browser window using Javascript

window.opener = self; window.close(); I recommend using it in a function like the following: function close_window() { if (confirm(“Close Window?”))…

Convert timestamp to string in Javascript

var timestamp = 1330056000000; startDate = new Date(; var month = startDate.getUTCMonth(); var day = startDate.getUTCDate(); var year = startDate.getUTCFullYear();…

How to install php modules

Type apt-cache search php5- Then apt-get install <<name_of_module>>  

How to display array in human readable format in php

To print the display in ‘human readable’ format, use the html preformatting tag before print_r: echo “<pre>”; print_r($myarray); echo “</pre>”;…

How to display errors in php

In php.ini ” nano /etc/php5/apache2/php.ini ” Change ‘display_errors’ from ‘Off’ to ‘On’

How to create a ‘select all’ checkbox in javascript

For HTML Code: <input type=”checkbox” onClick=”toggle(this)” /> <input type=’checkbox’ name=’ss’ value=’one’ /> <input type=’checkbox’ name=’ss’ value=’two’ /> <input type=’checkbox’ name=’ss’…

© 2020 DEVGET.NET. Theme by Anders Norén.