VoiDeT 04.26.08 // PHP // (50)
In this tutorial i will teach you how to make a guestbook script with PHP and mySQL. Guestbooks are very common today on the internet and are great for getting user feedback or a simple hello from your site fan’s. This tutorial will feature form submission techniques, user input error handling, smilies, honeypot traps, and [...]
VoiDeT 04.11.08 // PHP // (49)
If you have been doing the other tutorials on this site you will notice that I have been teaching PHP and mySQL through projects. Projects that you can slot into your website, or if you are building a project, code that you can use within your project. I start from the ground up, assuming you [...]
VoiDeT 04.08.08 // PHP // (3)
So you are using cookies on your website, but when a visitor visits www.yourdomain.com and yourdomain.com the cookie doesn’t get set across both! That is because in essence, www. is simply a subdomain. The “www” component is not a protocol, it is not necessary, instead all it is, is just a marketing ploy. But anyway. [...]
VoiDeT 04.08.08 // PHP // (1)
So you have completed the file upload tutorial. The tutorial has taught you how to upload an image using a form, and then it auto makes a thumbnail and shows it to you, nice. Now lets say you are on a public computer, and can’t save to the desktop or whatever. So you would like [...]
VoiDeT 04.08.08 // PHP // (7)
In this tutorial we will make a thumbnailing script using PHP. The script will allow your users to upload their images using a html form, and then be shown the thumbnail and a link to the file on completion. Also the user will be able to specify a max height or width if they want [...]
VoiDeT 04.08.08 // PHP // (0)
If you have a MySQL table and you want to know how many records there are in this table you can run a query on the entire table for example:
<?php
//setup a query to select all items
$query = mysql_query("SELECT * FROM `tablename`");
//now use the magic row counter droid
$rows = mysql_num_rows($query);
echo $rows;
?>
This will show you how many [...]
VoiDeT 04.08.08 // PHP // (0)
This tutorial is quite easy. If you want to connect to a mysql database you can use something like this:
$host = ‘localhost’;
$username = ‘yourusername’;
$password = ‘yourpassword’;
$databasename = ‘yourdbname’;
//don’t edit this stuff okay?
$connect = mysql_connect($host, $username, $password);
$selectdb = mysql_select_db($databasename);
if($connect == true){
echo ‘Connected fine!’;
} else {
echo ‘Bad Username or Password…..or host dummy!!!!’;
}
if($selectdb == true){
echo ‘Connected to DB [...]