Flash Vista - Home
Newest Cool Site
The Two Tales
Site info | Archive
Main Navigation
Home
New Links
Top Rated
Most Popular
Cool Sites
Search

Flash Tutorials
Flash Resources
Flash News
Flash Templates
Flash Intro Templates
Website Templates
Flash Games
Flash Books
FlashVista Polls
Sitemap


Random Link
English
Ljubov Kravtsova
Site info | Get another
FlashVista
Login
Register
Subscribe

Add Link
Modify Link
Favorites
Suggest Category

Advertise with us
Support us
Credits / Thanks
Contact

Flash Templates:

More Templates ...

Mailing List
User

Password



Register
Forgot password?
Partner websites
Flash Templates
Flash Components
Free Hit Counter
Free Seo Tools
Free Tutorials
Free Video Tutorials
Forum signatures
Other Resources
Suggest
Suggest this site to a friend


Mailing List
Status: Not logged in

English English German French Spanish Italian Portuguese Russian Polish Finnish Dutch Swedish Thai Romanian Traditional Chinese Simplified Chinese
SearchNot logged in
Keyword: Search for: Advanced Search


MySQL/PHP Driven Flash Guestbook


NEW Flash Tutorials in Video Format - Powered by LearnFlash.com: 45 minutes of flash tutorials now available in streaming format or download. Topics Include flash for beginners, text effects, actionscripting, audio/video, flash 8 and more.


Download the source file for this tutorial Printer version



By Joseph Miller
http://www.indivision.net


This is the first of a series of open-source applications that I intend on releasing that take advantage of the MySQL/PHP/Flash combination. By storing the guestbook entries in a database, you will be able to more easily manage and delete entries if necessary. Also, instead of loading the entire set of entries (as I have seen many flash guestbooks do) this book loads one entry at a time which is much quicker. And it even comes with a pre-loader built in! This book is a great project for designers who are new to making flash work with the back-end.

In order to use the files and follow this tutorial, you will need access to a MySQL database and a server that supports PHP.

Setting Up The Database

I have submitted a tutorial that explains how to set up a database. It's available on FlashVista as 'Setting up a MySQL database: for flash designers'. The same tutorial is also available on my home site at http://www.indivision.net in the fla section (chapter2 'DB4flash'). If this is your first project involving a database, I highly recomend that you follow that tutorial completely (including the setup of phpmyadmin) before attempting to continue with this tutorial.

Open the text file 'book.sql'. Cut and paste its entire contents into the query box of your phpmyadmin (see above tutorial for explanation) and click 'go'. The table will be created in your database that will eventually hold the guestbook entries.

Setting Database Variables & Uploading

Open the file called 'include.inc' located in the php directory. Enter the username, password and database name for the database that you created like so:


$DBhost = "localhost";
$DBuser = "yourUSERname";
$DBpass = "yourPASSWORD";
$DBName = "yourDATABASEname";


Now, upload the entire contents of the zip file included with this tutorial (except for the .fla file and the documentation) to your server. Be sure that the directory structure of the zip file is the same way you are uploading the book. In other words, all of the .php files and the .inc file must be in the 'php' directory which must be in the same directory as the guestbook.swf.

Final Notes

That's it. Point your URL to guestbook.html and you can enter a few test entries. Go back to your phpmyadmin or other database manager and delete the test entries.

NOTE: There is a flaw in the guestbook that becomes apparent once new entries are entered after others have been deleted. Sometimes the order of the entries gets mixed up because the new entries are placed in the spots where deleted entries used to be. It is possible to fix this problem by altering the PHP code but I wanted to keep everything simple and easier to learn from.

SECURITY NOTE: It is very important that you protect the folder where you have uploaded include.inc. If you don't, someone may get acquire access to your database and cause all kinds of problems for you. Check with your host/control panel about how to password protect a folder.

Let me know if you find this useful and please send a link if you use this guestbook on-line somewhere.

If you have any questions, please post them on the forum at INDIVISION. Good luck and I hope this helps.



(Added: 10-28-2003, Hits: 2, Rating: 3.16, Votes: 32, Reviews: 4)
Add to Favorites Suggest to a Friend

Reviews: (4)

you rock
(Added: 02-01-2007 User: Guest)

its soo cool ;)
(Added: 12-10-2006 User: Guest)

super thank you very much
(Added: 09-10-2006 User: Guest)

cool tutorial, thanks for posting!
(Added: 07-10-2006 User: Guest)


Add Review
Please note:
We review EVERY comment before it appears on the site, so please dont waste your time by posting spam links :)
No URLs allowed, no HTML please.

If you register or login first, your review will contain your nickname


Rate It



Excellent!
Very Good
Good
Fair
Poor