CrankBerry Blog Title

PHP Postings

2011


(9) Comments

Intalling Sphinx on Wamp localhost (Windows)

Categories :: MySQL, PHP, Web Hosting

I recall the first time trying to setup Sphinx search on my Windows machine with Wamp it wasn't so obvious of how it was to be setup. Here's a guide in how to get it setup on you local machine. If you want to install Sphinx on Linux / Plesk there's an article for that too.

2011


(6) Comments

Why do I get "page includes resources which are not secure"

Categories :: HTML, PHP, Web Security

You just built a site, and have implemented SSL, but when you go to test it you get "page includes resources which are not secure". This is annoying but you need to fix it.

2010


(4) Comments

PHP text based counter – script specific no MySQL counter

Categories :: PHP

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.

2010


No Comments

PHP Cron job without using Cron tab (cron alternative with MySQL or just txt)

Categories :: PHP

You may have the need to schedule a PHP script to run but don't know and don't want to bother to learn how to use CRON job. That is ok because when I develop for smaller clients with shared hosting I tend to use a different technique anyways. Here's my alternative to running a CRON tab.

2010


No Comments

The ultimate newb's guide to learning web development (Pt. 1: The Basic)

Categories :: CSS, HTML, Javascript, MySQL, PHP, Web Development

If you are just discovering the world of web development but know nothing about HTML code, css and mumble-jumble, here's a good place to start. In this article I will outline in general where to find resources and some good skills to pick up on to becoming a minor expert in the field.

2010


(2) Comments

Function to replace variable value in URL

Categories :: PHP

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.

2010


(2) Comments

Random row from your MySQL table with PHP, alternative to ORDER BY rand()

Categories :: MySQL, PHP

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.

2010


No Comments

Automated MySQL database backup with PHP and cronjob

Categories :: PHP, Tools, Web Owners

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.

2010


(1) Comment

Awesome image cropper/thumbnail maker script – Modified Marquee Tool

Categories :: Javascript, PHP

As I'm recoding my portfolio right now, I thought to myself – how great would it be to have a thumbnail maker tool. Some PHP or Javascript solution to crop images dynamically without the use of Photoshop. I would hate to fire up Photoshop every time I want to upload something. I'm sure you've all been there before. Anyways I landed upon a script that suited my need exactly. The Rectangle Marquee Tool. The tool looks great but was a bit confusing for me to get working and based on the comment for a few others too. Now I've also done some slight PHP modification to get the script working to my needs and generating the correct thumbnails.

See what I'm mumbling on about right here:
Demonstration of Marquee Tool

2010


(3) Comments

PHP password strength detector script

Categories :: PHP

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.

PHP Password Strength Detector Script