Here's a counter script that can help you count downloads, specific pages, or overall general count. This is a simple function that works by storing text rather than using a MySQL database. Just for quick usage.
Here's a counter script that can help you count downloads, specific pages, or overall general count. This is a simple function that works by storing text rather than using a MySQL database. Just for quick usage.
Passing variables through the URL is awesome but how do you update, say, the id or the page when there's twenty different variables (index.php?id=2325213&page=30&view=210&sort=213&user=231221). Here's a quick function to create a new URL string that will replace values of specific variables. You can also remove variables which are not necessary.
Working with MySQL and PHP is awesome. Its one of the best way to manage your data, but once in a while you may want to do some randomizing. One problem I came across recently was how to select a random row from your MySQL table with PHP. Using the ORDER BY rand() method in your query maybe a bit slow so here's what we've got.
At some point of working on your website you'll want to back up you MySQL database. This is they key for all of you building dynamic sites. If one day your server goes down or something you may have the files backed up but without the database you'll have to start from scratch again. If you operate a very slow-paced site then manual back up is fine but if you want to backup your database daily then it becomes tedious. I, myself is lazy so I came up with a PHP and Cronjob solution to automatically backup MySQL database.
If you operate a user registration script on your website you may want to ensure users are protected. There are certain aspects of this you cannot control such as the user's self selected password. Here I have a script that will detect the user's password strength and base on that you could reject the password or just make notice to the user their password's strength.
Although not recommended but maybe for some reason you need to create a PHP login without the use of any database (SQL). For some reason you maybe scared to approach, but here I made a script that is fairly secure without utilizing any database at all. It allows users to login and stay logged in. If you are one of those people then here's the script for you.