Follow: Like PHP-Scripting @ FacebookFollow Php-Scripting.com @ TwitterFollow Php-Scripting.com @ Google PlusSubscribe to PHP Scripting @ YouTubeSubscribe to PHP-Scripting.com RSS Feed

PHP Scripting - Free & Cheap Scripts, Tutorials & More Cool Stuff

Free & Cheap Scripts, Tutorials & More
Home Free Scripts
Donate A Coffee Contact
Share:

Check Username Entered Into A Form

Listed in PHP Tutorials
Check Username Entered Into A Form
There will always come a time when you will need to check and/or verify data entered into HTML forms. There are several methods for checking for data already stored in MySQL databases and while most coders will employ jquery in unison with PHP to do so, the method I lay out here strictly uses PHP.

Now, some coders may balk at my method, but we have to keep in mind that sometimes end users have javascript disabled in their browser. Most of the time, that means it won't work for them - or to your benefit. This PHP method has been tested in three different browsers, as well as on a PC, laptop and tablet.

Power Of PHP Request URI Function

Listed in PHP Tutorials
Power Of PHP Request URI Function
'(REQUEST_URI);' can be very powerful, yielding related results wherever called for when utilized in the correct context. This article explains how you could display related ad banners on a web page using this function and a MySQL database.

The example is simple and basic, but definitely provides the groundwork for something more substantial. If needed. By simply returning a web page, PHP can decide whether certain ad banners should be displayed in related pages. It's very handy.

Conditional Statements For Notification

Listed in PHP Tool Box
Conditional Statements For Notification
Status notifications are a must when running your own content management system. How else are you going to know if you have new emails, comments or even how many articles you've published on your site? These are all very relevant when you like to keep things organized.

I've covered Conditional Statements in the past, so for those who have browsed PHP-Scripting, this isn't a new completely new topic. Still, this short code snippet article could prove useful in a pinch if you'd like to return the status of particular events taking place on your website.

PHP Error Handling Functions

Listed in PHP Tool Box
PHP Error Handling Functions
Errors, mistakes, whatever we choose to call them, can be both frustrating and yet so helpful in becoming better at something. That certainly holds true with PHP, as well as in general life experience. Knowing how to handle errors is one of the best tools a web developer can utilize in becoming better at their craft.

There are many error handling functions within the PHP library, so I cover only a few in this article. I will provide a list that you can search for, however, leaving you with at least the ability to look them up and learn what they can do.

PHP Constant Function

Listed in PHP Tool Box
PHP Constant Function
Variables have been called the 'meat and potatoes' of PHP, and with good reason. Without Variables, we wouldn't be able to do much with PHP. That being said, it isn't the only way to define consistent aspects on a websites. We can also take advantage of the 'Constant' function.

Constants aren't quite as powerful as Variables and do have more limitations, but that doesn't mean they should be overlooked. Sometimes simple is the best policy when it comes to certain aspects of web development and you can't get much simpler than Constants.

Getting and Storing Visitor Information

Listed in PHP Tutorials
Getting and Storing Visitor Information
Getting information from the visitors who frequent your website is quite important. Specifically, if you own and run a business. By knowing their IP address, which usually represents their GEO location, what pages they have viewed on your site and what operating system and/or browser they're using, you can make their visiting experiences much more beneficial to them.

This being said, getting and storing visitor information can also assist in making your site and/or server more secure. After all, if you notice a particular IP address or bot continuously visiting the site you can use their IP address to limit their access. In this world full of hackers and ne'er-do-wells, there is no such thing as too secure.

SQL SUM Function To Return Data

Listed in PHP Tutorials
SQL SUM Function To Return Data
I could never say enough how much I appreciate the relationship between PHP and MySQL. Some programmers prefer larger database applications, but for the work I do, it is more than sufficient. Within it's vast library of functions, there lies the SUM function. It can be used in many different scenarios, in many contexts.

I thought perhaps some examples of using SUM in MySQL database queries would be helpful. My examples may be beneficial as well, as I retrieve website traffic statistics from a database with three separate queries. This articles is part of a series on creating your own, basic, website traffic statistics script.

Canadian ConFoo Developers Conference

Listed in Coding News
Canadian ConFoo Developers Conference
I've been to a few different web development conferences in my lifetime and I can honestly say that I had a good time in every occasion. I must be out of the loop though, as I just heard about the upcoming ConFoo conference being held in Vancouver from December 5-7, 2016. Which is in my neck of the woods.

The conference will also be held in Montreal from March 8-10, 2017, for those who reside in eastern Canada and/or North America. While I will say that ticket prices are higher than the last time I attended a developer conference, these events look quite intriguing. Some of the biggest names in internet development will be there.

PHP Post and Get Methods

Listed in PHP Tutorials
PHP Post and Get Methods
One of the most common questions asked in regard to dealing with HTML form data processed with PHP is 'Should I use GET or POST?'. As you will see in this article, it all depends on what kind of data someone is posting, where it will end up, how it will be used and how much safety has to be in place when using the form.

When it comes to allowing end users to send data on your website, you can never be too safe. Things happen. Even a simple mistake can prove disastrous. I only cover the very basics of the POST and GET methods here, as there are dozens of configurations a person can use. I do, however, discuss the differences between the two and provide examples for each.

PHP Scandir Function Usage Example

Listed in PHP Tutorials
PHP Scandir Function Usage Example
I have covered the Scandir PHP function briefly in the past, but I thought it might be useful for those who use their own content management systems to see how displaying images with this great function can be carried out.

This article covers just one of many ideas, but it should provide the gist of the utilization of Scandir. We can return either the image file names, and/or, as provided in the second example, a table grid of the images for viewing reference. The possibilities really are almost endless.

Upload Files and Produce HTML Code

Listed in PHP Tutorials
Upload Files and Produce HTML Code
I thought perhaps a short tutorial based around my Quick Image Code Creator free script would be helpful to those looking to create HTML codes on the fly after uploading a file.

As with the free script, my example uses image uploads. However, this small script could be amended to accommodate any file type. Why hand code HTML after uploading a file when you can utilize a PHP script like this?

File System Functions in PHP

Listed in PHP Tool Box
File System Functions in PHP
Last week I covered the basics of reading files with PHP, however, I thought it might be a good idea to elaborate on the topic a bit more. There are many functions that can be used when handling system files, so I only cover a few here in order to keep things simple.

I use these particular system file handling functions on a regular basis when scripting content management systems and websites for clients. Whether it's something as simple as checking to see if a file exists, or backing up particular files, these functional examples should be quite helpful to those who code with PHP.

Reading File Contents With PHP

Listed in PHP Tool Box
Reading File Contents With PHP
Whether one chooses to use the function 'fopen' or perhaps 'file_get_contents', PHP offers several ways to read and manipulate file content in order to return it accordingly. In this article I cover a basic 'fopen' statement, then expand on the return by utilizing 'file_get_contents'.

If you are looking to turn a list of items into URLs, this is the article for you. It's much easier to do than you may think. Follow these examples and you should be on your way to creating URLs on the fly from a simple txt file list.

Variable Handling Functions PHP

Listed in PHP Tool Box
Variable Handling Functions PHP
I've covered variables fairly extensively here at PHP-Scripting. However, what I haven't touched on yet are functions that allow for the manipulation of variables within PHP. Finding out what types of variables they are and handling them accordingly can make for a much better script.

I cover 4 basic examples here with variable functions that I personally use fairly often. There are several to choose from within the PHP language though, so be sure to do your research beyond my site. I provide a link at the end of this article which will help you expand your research.

Regular Expressions Introduction

Listed in PHP Tutorials
Regular Expressions Introduction
There are a few names for them, PHP regular expression functions. Regex is quite common, however, the official PHP site refers to them as PCRE functions. Which is probably the proper terminology to use, as they are the official site for the PHP language.

There are quite a few things you can do with Regex functions, as well as numerous ways of configuring expression syntax. A visit around the net will help you get more familiar with how to configure them properly. For this article though, I keep things pretty simple while presenting a few basic examples.
Article Categories
Free Scripts Added
May 13, 2016

Quick Link Builder

Quick Link Builder Read about it »
April 4, 2016

Quick Image Code Creator

Quick Image Code Creator Read about it »
March 26, 2016

PHPJQ Image Gallery Creator

PHPJQ Image Gallery Creator Read about it »
More Site Additions
May 28, 2016
The browser version of Quick Link Builder is now available for everyone to use - free, of course. It can be found here. I hope it can be of good use to you.
May 28, 2016
PHP-Scripting.com is growing quickly as I continue to publish coding related and general articles, so I figured it was time to script up a search engine. It's bare bones, but should supply you all with a way of finding particular articles on the website. I hope it works well for you.
March 30, 2016
I wrote up a comment script and implemented it into the site here for each article page. I may add it to other pages, but for the time being it will work just fine for people to leave comments on the articles, if they wish. Try it out and leave a comment in the box located at the bottom of an article page. :-)
Recent Article Comments
"I've been learning a lot here and really appreciate it. Thanks."
Read article »
"Being a beginner to PHP this is way over my head. I'm sure I will eventually get it but I could use more tutorials for beginners. Do you plan on doing more tutorials for newbies?"
Read article »
Recommended Reading

Jquery Pocket Reference

Jquery Pocket Reference
You know you're a total code head when you carry around a Jquery pocket reference book. ;-) That would be me. I'm still not very good at Jquery, in my opinion, but I continue to try to learn it and this book has been pretty helpful with that.

The paperback is small and pretty tough. I should know because I've put it through a beating. I recommend it to those who want to have a good Jquery coding reference kicking around. It's available for Kindle too.
Get it here »

CSS3 - Missing Manual

CSS3 - Missing Manual
Whenever I have some free time I try working on gaining a more modern understanding of CSS and in particular, CSS3. I purchased this book for Kindle about 3 months ago and so far it's helped me learn a lot.

Fair warning though for those who are used to older versions of CSS. There are a lot of new concepts being used in CSS3, some of which are a bit hard to wrap your head around at first. I hear that CSS3 support is growing quite rapidly and with the power of it the possibilities in regard to web design are almost endless. A very helpful book to have around, indeed.
Get it here »

Mastering Responsive Web Design

Mastering Responsive Web Design
I never thought I would actually buy a book on responsive web design but about 3 years ago I was getting rather frustrated with trying to get websites to look half decent on small screens. Mastering Responsive Web Design helped me immensely in learning what to do and most notably, what not to do when it comes to responsive design.

This is a later edition, released in 2015 and is even better than my older version. Things have gotten a bit easier with responsive web design over the past 3 years but I still have to be thankful for this book.
Get it here »

PHP & MySQL for Dummies

PHP & MySQL for Dummies
This is one of the books I keep around as a desk reference for PHP and MySQL coding. It was a great book to learn from too, I can tell you that. While not all the 'For Dummies' books are good, this is one of the better ones. I don't say that lightly, either.
Get it here »
Fun Coding T-Shirts