Category Archives: PHP Lessons

PHP Web Development

PHP is a processor that resides on a server to process information. Most of the time this is done with a MySql Database. PHP processes forms, writes HTML and more on the internet. Below there are several articles and tips and tricks on how to use this software. PHP is a free and open source software and is the most popular processor on the internet. The website for PHP is php.net

If you need to disable php on a directory with htaccess here is your script. Open up your text editor and paste this code in it. [code]<Files *.php> deny from all </Files>[/code] Upload it to the directory that you do not want PHP code executed. Most folders that are hacked in WordPress are… wp-content/uploads/ wp-includes Read More

PHP Web Development

I needed to delete duplicate entries in MySql with PHP. After some trial and error I wrote a script that will do it for me. What I needed to do was delete duplicate email addresses in a email script. Here is the code that made that magic happen.   [code] $result = $con->query("SELECT email FROM Read More

use-php-to-mail-a-form

Using php to mail a form is a simple task. Grab the codes below to learn how to do it yourself. This is continuation of our last lesson “Create a Form in a PHP Function“. Edit the Functions.php File In order to accomplish this you will edit your functions.php form to look like it does Read More

Have you ever wanted to put a form in a php function? You can do it and it is fast and easy. You can use this function anywhere on your website. Steps to Creating a form in a PHP Funtion First create 2 files, index.php and functions.php. These files will work together to get the Read More

Block Hackers with PHP and Mysql 2

If you want to block hackers automatically you have come to the right place. This of course is a PHP and MySql programming tutorial. Set Up Your Database The first thing that you have to do is set up your database. If you already have a config file similar to the ones that we show Read More

Warning: unlink(): http does not allow unlinking in PHP

In order to delete an image or file off of your server in PHP you have to use unlink(). This function will delete the file from your server. This is a permanent action and can not be undone once we completed the process. If you’re getting warning: unlink(): http does not allow unlinking in PHP, Read More

PHP Web Development

There are many times when you have to PHP MySqli Check For No Results in Database. Maybe you are checking the username and password of a user and match it to an authenticated user. Prerequisites for PHP MySqli Check For No Results in Database In order to perform this query you will have to have something in your Read More

php-html-email-script

If you are looking for PHP HTML script for emails you have come to the right place. If you look at our PHP Snippets for email. You may be disappointed that when you send an email that you do not actually see formatted HTML. PHP Header For HTML Email Emails do not automatically display HTML. Read More

email every hour with php

Why would you want to send emails every hour from your server? Most servers only allow you to send out 250 emails every hour and some servers only allow you to send out 500 emails a day. Let’s say that you have 5000 subscribers to your blog and you are not using 3rd party applications. In Read More

We can direct people to our mobile site using JavaScript. What this following code does is look for a screen size and then redirects the user. [code] <script type="text/javascript"> if (screen.width <= 699) { document.location = "mymobilesite.html"; }[/code] The following code will target iPhone and iPods to your mobile website. [code] if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) Read More

PHP Web Development

I thought it was time that I made a simple post on using AJAX. This is a very easy script for you to develop from. The main thing that you want to keep in mind is that you have to put the following script into a file called test.php. Further Instructions for Mysql You will Read More

PHP Web Development

Sometimes we need to encrypt a password hash in php before inserting it into the database. The code below will reveal this information. $1$aGwdyCbv$dwOWTv3mGDXIH0tHK7Ova1 hash [code]<?php $passwordtohash = ‘mypassword’; $hash = crypt($passwordtohash); echo $hash; echo $passwordtohas; ?>[/code] Explaining the Crypt Code and Process The php variable of $pass is holding within it “hash”. We then Read More

Retrieving Data From MySql with PHP

Retrieving data from MySql with PHP is a simple process however you should have the following things set up before implementing this process. You Created A Database You Granted Privileges to the database Created a config.php file to access the database After you insert data into a database you will eventually need to be retrieving data Read More

Installing and Configuring WAMP for the First Time

Installing and Configuring WAMP for the First Time can be a daunting task. The process is actually a lot simpler than many people think. WAMP has come a long way and made the process quite simple. What is WAMP used for? WAMP installs on a windows machine and can give you an internet environment so Read More

Update a Database in PHP MySqli

To Update a Database in PHP MySqli you will have to make sure that the following steps have been taken. You Created A Database You Granted Privileges to the database Created a config.php file to access the database Make sure you Connect to a Database before using this code. The purpose of updating a database is that Read More