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);
Feeding Your Inner Developer
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);
Most likely, the issue is with your php server randomly choosing a timezone and therefore having times which are usually either one hour behind or one hour after..
To solve it, right before the ‘mission critical’ area of your script, use date_default_timezone_set() .
An example of this is
date_default_timezone_set('America/Dominica');
Note: you can test your timezone with
echo date_default_timezone_get();
Luckily for us there is an ADDTIME function we can use to add and remove from times… The syntax is as follows: ADDTIME(datetime,time_to_change) example
SELECT `emp_id` , `clock_time` , ADDTIME( '-01:00:00', `clock_time` ) AS new_time FROM `timeclock`
Will return
emp_id | clock_time | new_time |
10059 | 08:30:55 | 07:30:55 |
10059 | 08:31:06 | 07:31:06 |
10059 | 08:31:28 | 07:31:28 |
10046 | 08:33:44 | 07:33:44 |
An Update example
UPDATE `timeclock` SET `clock_time` = ADDTIME( '-01:00:00', `clock_time` ) WHERE `id` BETWEEN 40967 AND 41022
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 php5-mssql)
For most instances that may be enough to give you what you need. If by any chance that doesn’t work, or you need more ‘functionality’ you can try (untested by me)
apt-get install php-pear pear install --nodeps MDB2_Driver_mssql
window.opener = self; window.close();
I recommend using it in a function like the following:
function close_window() { if (confirm("Close Window?")) { window.opener = self; window.close(); } }
var timestamp = 1330056000000; startDate = new Date(ev.date); var month = startDate.getUTCMonth(); var day = startDate.getUTCDate(); var year = startDate.getUTCFullYear(); newdate = year + "/" + month + "/" + day;
Type
apt-cache search php5-
Then
apt-get install <<name_of_module>>
To print the display in ‘human readable’ format, use the html preformatting tag before print_r:
echo "<pre>"; print_r($myarray); echo "</pre>";
In php.ini ” nano /etc/php5/apache2/php.ini ”
Change ‘display_errors’ from ‘Off’ to ‘On’
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' value='three' />
We use Javascript:
<script> function toggle(source) { checkboxes = document.getElementsByName('ss'); for (var i = 0, n = checkboxes.length; i < n; i++) { checkboxes[i].checked = source.checked; } } </script>
Recent Comments