Part 1 – Overview of Functions, Database & Files Overview In this tutorial we’ll be creating a very simple blog system. We won’t be using OOP yet in this tutorial. For creating a Blog using OOP in PHP, another more advanced tutorial will be written and posted as well. The same goes for creating a more advance [...]
Continue reading...onsdag, marts 3, 2010
Kommentarer slået fra
1) Function for stripping out malicious bits <?php function cleanInput($input) { $search = array( '@<script[^>]*?>.*?</script>@si', // Strip out javascript '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments ); $output = preg_replace($search, '', $input); return $output; } ?> 2) Sanitization function Uses the function above, as well as adds slashes as [...]
Continue reading...torsdag, februar 25, 2010
Kommentarer slået fra
It has been a while since we’ve done a proper PHP & MySQL tutorial here, So today we are creating a simple, yet robust, file download tracker. Each file will have a corresponding row in the database, where the total number of downloads is saved. PHP will update the MySQL database and redirect the visitors to [...]
Continue reading...torsdag, februar 18, 2010
Kommentarer slået fra
It’s very important to secure your data in PHP correctly. Because if you don’t, your website is in risk of being harmed by SQL injections and other dangerous code injections, which you obviously don’t want. So to protect your website against these code attacks, this tutorial was written ;) This tutorial will explain the reasons to [...]
Continue reading...tirsdag, februar 16, 2010
Kommentarer slået fra
An unobtrusive login system is one that gets out of the user’s way. It will make your application nicer and more polished. This article will guide you through the process of setting up user logins, then ajaxifying the process by moving the form into a modal box that communicates with the server. Additionally, this article [...]
Continue reading...lørdag, februar 13, 2010
Kommentarer slået fra
Today, we’ll be creating a nice user poll script using jQuery and PHP utilizing AJAX and animation effects of jQuery to spice up the user interface and provide a rich user experience. Let’s get started. Set up the database For storing poll questions, options and votes, we’ll be using a MySQL database. Here is the database structure [...]
Continue reading...lørdag, februar 13, 2010
Kommentarer slået fra
How it’s done <?php foreach ($comments as $comment) : ?> <li id="comment-<?php comment_ID() ?>" class='comment'> <!-- the comment stuff --> </li> <?php endforeach; ?> The code above shows an ordinary comment loop (except the content inside of <li> which is removed due to clarity). Now we can update this code in 2 ways to get what we want. The first one is [...]
Continue reading...lørdag, februar 13, 2010
Kommentarer slået fra
First I want to take the time to thank you, Tutorialzine’s readers, for all your support the past year and to wish you a happy new 2010! A lot of interesting tutorials are on their way and there are also some nice changes planned which I am sure you’ll like. Now lets start the year with [...]
Continue reading...lørdag, februar 13, 2010
Kommentarer slået fra
Today we are making an AJAX-enabled Sticky Note management system. It will give visitors the ability to create notes with a live preview, and move them around on the screen. Every movement is going to be sent to the back-end via AJAX and saved in the database. We are using version 1.4 of jQuery and the [...]
Continue reading...lørdag, februar 13, 2010
Kommentarer slået fra
Every developer, at one point in time, will run into a situation where they need to display a small amount of dynamic data. Why create a whole database? Enter the magical world of XML. XML is easily manageable by anyone who has ever even dabbled a bit in HTML, so understanding should come easily just [...]
Continue reading...
torsdag, marts 4, 2010
Kommentarer slået fra