newklearblog

Home of the mighty Benjamin “Adolphus Ricardo Jesus Quintin Calmelita Def” Alldridge

Guestbook-0.8a

IMPORTANT! This is no longer officially supported or being developed, use at your own leisure/torment. Thx.

The Lowdown

So, I got to writing some random PHP stuff to learn how to do it, and this just happens to be one of those things. I wrote the initial code on the first night of actually learning how to use MySQL databases and PHP together. Admittedly, it’s far from complete, and far from being bullet-proof and invincible, however, it does do the job it was intended. Currently, it is supported on virtually any platform I can think of >= PHP3 && MySQL 3, that’s just how simple it is. And to make it even simpler, there is only about 5 things you actually need to touch in it anywhere (by that, I mean 5 actual words; that’s it).

It consists of four parts; an Index file (To display the database information and interface with the main script); a Global file (Which contains the editable parts); an Add file (Which is the script itself, and contains the vital stuff.); and finally, a Db file (Which creates the needed database and tables). All of these sit in the same directory, and basically interface with one another.

Getting It Going

  1. Grab yourself a copy of Guestbook hot off my server
  2. Unzip it to whatever directory on your Hard-Drive you feel appropriate. Or your Floppy Disk. Or whatever other storage media you deem appropriate for this storage of files.
  3. Choose your favourite editor (I recommend Notepad, as it’s simple and efficient) and open “global.php”
  4. Change the “CHANGEMEPLS” to replicate your own server’s settings
  5. Save the file, and open “add.php” in the same editor, then search for the value, “YourURLhere.com” and change it to whatever your website’s URL is, omitting the http:// and www. at the front (Depreciated as of Version 0.7 Alpha (”Jackson”). Now part of the “global.php” file as $yoururl.)
  6. Upload the edited files to your server, and run “db.php”. This should automatically create the needed databases for you, along with the tables as it needs them. If this is not the case, open open phpMyAdmin (or similar; if available) and create a new database with any name you like. Take the name of the new database and insert it into your “global.php” file.
  7. Test the script (duh!) and if it works, link all your bestest buddies to it to sign. Of course, there is no actual style information included here, so it may look a bit.. plain, unless you add some of your own trickery to it.
  8. - ????
  9. Profit!
  10. If the script does work, create a user specifically linked to this database, which should have a rather random password, and the following privileges: SELECT, INSERT, UPDATE, INDEX. NEVER under any circumstance run with your master account and password, unless it is an absolute impossibility to avoid it. From there, insert the new user’s name and password into the “global.php” file, and test the script again (keep a backup of the original, just in case).

This script is free-for-all, so feel free to edit it and distribute it as you please. Just, if you edit it, gimme a little bit of credit and show me what you’ve done eh? All in the name of learning, baby. Oh, and don’t go making any cash off of my code.. that’d make me sad. I’m not Microsoft, y’know.

Changelog

  • Version 0.8 Alpha (”Matthews”)

    • Added some sexy error reporting a-là Switch
    • Tidied index.php ever so slightly
  • Version 0.7 Beta (”Stipe”)

    • Added pages to the index file
    • Tidied some code
    • Minor display adjustments
  • Version 0.7 Alpha (”Jackson”)

    • Edited the connection system to run smoother
    • Edited the database creation system to be more flexible
    • Added a bulk of code to both the index and database add files
    • Edited the code and increased security on the entire scriptset
    • (Hopefully) squashed some bugs in the last release
  • Version 0.6 Beta (”Cash”)

    • Edited the code to have increased security
    • Edited the code to have better database support
    • Streamlined some of the code from the previous version
  • Version 0.6 Alpha

    • Cleaned the previous code to have better support for more platforms
    • Fixed some display errors
    • Updated database creation tool
    • Unified some code and removed some other code
    • Added cookie support
  • Version 0.5 Beta

    • Modified the script to contain seperate files, rather than just a single file
    • Built a more reliable backend
    • Included some code to die when empty fields are found
  • Version 0.5 Alpha

    • Released the script for “public” testing
    • Heavily modified the database code
    • Reworked some display issues
    • Stripped some “useless” code back
    • Made the database contain more useful information
  • Version 0.1

    • Wrote the script
    • Rewrote some database connectivity issues
    • Rewrote some display issues

Planned Updates

  • Administration Panel
  • Comment Deletion/Edit Utility
  • Email Notifications (togglable)
  • Comment Encoding
  • Anti-Spam
  • Comment Verification System
  • Conversion to Functions
  • Pages! For the love of God, PAGES! (Implimented and working as of Version 0.7 Beta (”Stipe”))

For now, those will have to wait, along with a few others that don’t spring to mind right now. They will however, get built in and the script more refined as the weeks pass.

And thanks to Kylie for helping me debug it; she is smexi

Technorati Tags:

Malarkey

Trackback

fuelled by newklearsyndicate
Copyright © Benjamin Alldridge, 2008. Powered by Wordpress, and fuelled by newklearsyndicate. | top?