Tag Archive | "MYSQL"

Creating a simple Blog System – Part 1

torsdag, marts 4, 2010

Kommentarer slået fra

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...

Retrieving User Input Data

onsdag, marts 3, 2010

Kommentarer slået fra

In this tutorial we’ll be retrieving data from form fields. To do this we’ll first create an example form. We’re using the POST method to send the form data in the first example. Will later explain what this means, and how we can then retrieve the data from the form fields. Also the GET method [...]

Continue reading...

Sanitize Database Inputs

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...

PHP and MySQL File Download Counter

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...

Securing data in PHP

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...

AJAX User Poll Using jQuery and PHP

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...

How To Style Admin Comments In WordPress

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...

Advanced Event Timeline With PHP, CSS and jQuery

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...

AJAX-enabled Sticky Notes With PHP and jQuery

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...

Create Dynamic Images With PHP/MySQL

lørdag, februar 13, 2010

Kommentarer slået fra

You can view the demo of what we will be creating here: Dynamic Images I will be using my local server to do this tutorial, first off with need to create some data to use in this tutorial. I have provided a MYSQL Query string for you to use. I am using PHP 5.3 and MySQL [...]

Continue reading...