6 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Dani

Here is the function that I use here at DaniWeb to manage flood control. It keeps track of how often a specific user or IP address is making a request, and increments a counter. If there have been no requests after 5 minutes, the counter resets to 0. It returns …

Member Avatar for Dani
4
406
Member Avatar for Dani

A little while ago, I wrote a [tutorial](https://www.daniweb.com/programming/web-development/tutorials/537376/sanitize-php-user-input-strings) about how important it is to sanitize PHP user input strings. Not only is it important to sanitize user input being fed into a database query, but it's also important to sanitize user input being displayed to the end-user to generate valid …

2
196
Member Avatar for Dani

DaniWeb is built on top of the Codeigniter 3.1.x PHP framework. Although I probably should have built it as a CI model, here is the database library that we are using. You can see it mainly serves as a wrapper for CodeIgniter's built-in database class. You can see we use …

1
129
Member Avatar for Dani

I recently had to mass insert a really large text file of strings into MySQL. Here's how I did it.

Member Avatar for PARDEEP_2
1
1K
Member Avatar for veedeoo

Hello Everyone, I wrote this script way back in 2008 as Version1. However, I was forced to forget about this, because it was criticized by many developers with BS, MS, and "Seasoned PHP Developer" under their names. During those days, I couldn't stand up for my own reasons, because I …

Member Avatar for veedeoo
2
2K
Member Avatar for cereal

#This is for Laravel 3.*# ## Hello, ## With this snippet I'm providing a simple way to automatically filter `Input::get()` and `Input::old()`. To achieve this result we need to make few changes: * extend Input and Redirect classes by creating new files in `application/libraries/`, the files are: **input.php** and **redirect.php**; …

1
374

The End.