Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
February 09, 2010, 08:24:19 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Come and join us and ask a question!
REGISTER NOW!
Make a new post
Get Updated Drivers
3085
Posts in
672
Topics by
304
Members
Latest Member:
bearyjanie
PC Tips Forum
|
Tutorials
|
What is??? How to???
| Topic:
Developing a Guestbook
0 Members and 1 Guest are viewing this topic.
« previous
next »
Pages:
[
1
]
Author
Topic: Developing a Guestbook (Read 3774 times)
Merlin33069
Administrator
Offline
Posts: 227
Developing a Guestbook
«
on:
March 26, 2009, 12:05:42 AM »
VERSION 5.0 COMPLETE
I changed several things, you will have to look to see them
DEMO SITE NOW LIVE
This is dak's site, he is going to use the script and as such this is a link to where he currently has that script, go leave a comment!
Current version = 4.0
http://daksters.com/guest/
3.0 BETA3
http://merlin33069.byethost2.com/
NEXT VERSION
Will be working on requests, pretty much, here on out!
GUARANTEE
guaranteed clean* by TimmCo Computer services
*(clean refers to viruses malware and other forms of intrusion, not scripting cleanliness, and we have no control over our hosting site, rest assured we take every measure to ensure your well being)
COMMENT PAGE IS COMPLETE
, this was made for Mitz... but im going to go ahead and release it.
This is the same thing as the above guestbook script except that it only has the Name and Comment fields
Read the readme to configure
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #1 on:
March 26, 2009, 12:15:12 AM »
Ok, so the basic guest book will be something like this;
the table will have a few columns:
Number
Smiley
Name
Date
Comment
And the form to add a new line to the table will have:
Smiley
Name
Email
Comment
So that the persons Email will not show in the guest book, and the numbers are auto incremented in the database
The admin panel will have the following:
Modify
-Number
-New Comment
Delete
-Number
Ban
-ip
So that you modify and delete by the auto incremented Number
im not sure how to change the timezones to the users zone, so i will have to look that up
The ip ban is for banning a specific ip
(The board will collect the ip and add it to the database)
Colors will be done in the php pages, and the pages will be set up as follows
Mysql section -For connection information to the mysql server, password, host, user, port etc
Display section - This will have the colors and even the table width percentage (html code)
The whole page will be scripted in PHP and will be freely available to anyone whom wants it, courtesy of TimmCo (pre version 5.1)
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #2 on:
March 26, 2009, 02:58:49 AM »
ok, i would like to point out here that you may add anything you would like to this post, this is not like the HTML tutoial, this is more of a development procedure, and i can use help and will take criticism from anyone
So the code i plan on using for the BAN statement is:
Code:
<?PHP
$banned[0]="$Ipaddress";
if (in_array($_SERVER['REMOTE_ADDR'],$banned))
{
header("HTTP/1.1 403 Forbidden");
exit;
}
?>
Where "$Ipaddress" is where it will look in the MYsql database for a list of ip's to block, its list that it will use
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #3 on:
March 27, 2009, 02:28:47 AM »
Form for Signing the Guestbook
Code:
<table>
<form action="Guestbook.php">
<tr><td>
Smiley:
<td>
<select name="Smiley">
<option value="Happy">Happy</option>
<option value="Sad">Sad</option>
<option value="IDK">IDK</option>
<option value="IDK">IDK</option>
</select>
<tr><td>
Name:
<td>
<input type="text" name="Name">
<tr><td>
Email:
<td>
<input type="text" name="EMail">
<tr><td>
comment
<td>
<textarea rows="4" cols="25">
Enter your comment here, you can put anything comment you like here, note your ip address is logged to our database, and any improper postings will be removed, and the maker banned
<tr><td>
submit
<td>
<input type="submit" value="Submit">
</table>
not quite done yet, i need some more smileys, maybe i will take the pack from this forum
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #4 on:
March 27, 2009, 05:17:34 AM »
OK, so we need to have some variables in this guestbook that are easy to define, at the begging of the document, such as info for the MySQL database, and colors, and a few other things... here are a few that i have thought of for now, note this is scripted as it would be in php, so you can once again see how i would do it.
this would be Guestbook_Config.php
//CONFIGURATION
//Edit the following lines of code to configure your Guestbook
//MySQL Database information, this section is for the Mysql info only
//The hostname is normally the ip of the computer that the server is running on, normally this would be localhost, signifying that it is running on the same computer
$Hostname = 'Hostname';
//The username, needed to login to the database, default is root
$Username = 'root';
//Password, also needed to login to the database, default is blank (note it goes between the two ' characters)
$Password = '';
//Color, this is the color section, use it to change the look of your page
//Background color
$BGColor = 'White';
//Text Color
$Color = 'Black';
//Table Properties, this would be the configuration for the table that the guestbook is in
//Table border, how many pixels wide is the border around the table
$TableBord = '0';
//Table width, the width, in either % or PX (Pixels) of the table the guestbook is in
$TableWidth = '80%';
Once again, any criticism and or advice would be most welcome...
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
GUESTBOOK - VERSION 1 DONE (check 1st post to download)
«
Reply #5 on:
March 27, 2009, 10:07:48 AM »
VERSION 1 DONE (check 1st post to download)
OK, version 1 of the guestbook is done, this has no admin panel, or smileys, instead it has a mood column and the changes must be made through the database
Changes that still need made:
Consolidate Files if possible
Admin Panel
Admin Database for login information (might be built into the php)
Make a better sample page (the index page with this one sucks, but its not meant for you to use it)
and anything else i can think of
This will be it for a while, its pretty cool, but i will get... mad at it... if i keep going
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #6 on:
March 28, 2009, 05:23:16 AM »
V 1.1 is done, this has the Table creation built in, (see readme) and has a whole new readme (see readme
)
Next version will have A dynamic table name as well, now that it is incorporated into the script, and will have the beginnings of an admin panel
See post one to download!
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Dak
Administrator
Offline
Posts: 469
Creating a webpage for the guestbook.
«
Reply #7 on:
March 29, 2009, 03:55:11 AM »
STAGE 2 - Incorporate the guestbook into a custom designed webpage.
This guestbook will now be developed into an attractive webpage, with headings, navigation links and advertising. It will be composed of both html and javascript code, and also include the php code for the guestbook. The resulting file will then be named index.php, the guestbook will still be updated and edited, new features will also be added.
Anyone interested should watch this guestbook
http://daksters.com/guest
to see it develop. I'll post a breakdown of the html and javascript code as I write it, explaining each part of the code and its purpose.
Logged
Check out my personal website,
http://daksters.com
, for my opinions on life, the universe and everything!
I'm very opinionated, and I'd love to get some honest discussion happening about my views! I dare you!
Also featured are many galleries of my amateur photography, and an Australian Music Jukebox.
Dak
Administrator
Offline
Posts: 469
Creating a webpage for the guestbook.
«
Reply #8 on:
March 29, 2009, 12:29:08 PM »
OK, here we go.
First we need a basic page, It needs a beginning, a header, a body and an end.
We begin by adding the beginning <html> marking the beginning of a html document, followed by <head> the beginning of the header.
<html>
<head>
The header is information which is meant to be read first by your browser, but is not intended to be visible on the actual webpage.
The header could contain lots of stuff, but at this point, we are just adding a title. The title is the text you see along the top of your browser, and the same will show in the tab if you have multiple tabs open.
Every html command needs to be opened and closed. We haven't finished with the <html> command yet, nor are we done with the <head> command, so these havent been closed yet.
To add the title, we add the command <title> then enter the title, in this case 'Guestbook'.Thats all we are putting in the title, so we can close that command by adding a / to the open command... </title>
Now everything between <title> and </title> will be displayed as the title ie the word 'Guestbook'
<html>
<head>
<title>Guestbook</title>
So far, we are only adding the title to the header. We will add more later. This means we are finished with the header, so we can close the header command with </head>
<html>
<head>
<title>Guestbook</title>
</head>
Now its time to move to the body of the page. After the head comes the body, so we will open the body section with <body>
We'll insert stuff into the body soon, lets just get the page built. We will close the body with the command </body>, then add the command to end the html page </html>
<html>
<head>
<title>Guestbook</title>
</head>
<body>
</body>
</html>
Note the empty lines between each section. These in no way affect the webpage.
This whole section could have been written as
<html><head><title>Guestbook</title></head><body></body></html>
with no effect on the way the webpage is displayed.
The lines between the sections are for us. Its a lot easier to read this way!
Now to add the PHP commands that place the guestbook on the page. Ryan has built a PHP guestbook, and this has been uploaded to the website. We need to direct the html webpage we are creating to include Ryans guestbook, so we need to insert a PHP section. Its the main body of the webpage, so it needs to go between the <body> and the </body> tags.
To make the PHP work, we need open and close commands just like the html code, but we'll use <?PHP and ?> to do this, as its PHP not html. Here is the PHP section added.
<html>
<head>
<title>Guestbook</title>
</head>
<body>
<?PHP
?>
</body>
</html>
Now its time to add the actual PHP commands. We want to include 2 files, 'GBupdate.php' and 'GB.php'
'GBupdate.php' is the form users fill out to add an entry on the guestbook, and 'GB.php' is the actual guestbook... the entries users have made. Since we want to have the form on top, and the entries below that, our first command will be
include ("GBupdate.php");
<html>
<head>
<title>Guestbook</title>
</head>
<body>
<?PHP
include ("GBupdate.php");
?>
</body>
</html>
Now we want to separate the form and the entries a little, so we will add some space. Browsers dont see spaces as gaps between lines, we have to actually tell it we want some space. To do that, we need to revert to html for a moment. Remember we are currently in a PHP section, so we need to tell it to use html for this command.
With the following command it was necessary to substitute * for < and > to make it display properly in this post, because the bbc code that this post is written in also uses the command br and it sees this code and tries to use it. When writing this code, you would replace the * with a < before the command or > after the command!
this is done with the command 'echo'. we are going to add some line breaks *br*, each of which is just like hitting the 'enter' key. So, now we will have a command echo '*br**br**br**br**br*' We'll add this to our script.
<html>
<head>
<title>Guestbook</title>
</head>
<body>
<?PHP
include ("GBupdate.php");
echo '*br**br**br**br**br*';
?>
</body>
</html>
Now we can include the actual guestbook entries below the form, by adding the command include ("GB.php");
Remember, "GBupdate.php" and "GB.php" are files which Ryan has created for this guestbook, and these commands are specific for this guestbook only!
<html>
<head>
<title>Guestbook</title>
</head>
<body>
<?PHP
include ("GBupdate.php");
echo '*br**br**br**br**br*';
include ("GB.php");
?>
</body>
</html>
OK, so now we have a page with our guestbook displayed in it. We'll add colour and text formatting in the next lesson. We will also need to add later lots of other stuff, like meta tags, advertising etc, but we will do this one step at a time.
The above script, in combination with the PHP guestbook script which Ryan has written and I have already set up on my server as you have seen us talking about, is the entire page displayed here....
http://daksters.com/guest
Note that you will actually be going to http://daksters.com/guest/index.php if you click that link. Browsers will always look within a folder (in this case the folder 'guest') for a file named index. Since there is a file in that folder called index.php, the browser will find and open that one. If the browser cant find an index, it will list all files and folders within the nominated folder instead.
Note: you will also see on the linked page, as it stands now, a credit to Ryan and his business, with links. These were included in the GBupdate.php file, so when we have called for that file, we have automatically got that as well
Logged
Check out my personal website,
http://daksters.com
, for my opinions on life, the universe and everything!
I'm very opinionated, and I'd love to get some honest discussion happening about my views! I dare you!
Also featured are many galleries of my amateur photography, and an Australian Music Jukebox.
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #9 on:
March 29, 2009, 03:09:50 PM »
note that i have found another bug that i will look into fixing, and it wont be too hard
the table allows for empty spaces... i will fix it in the next version also, that brings us to.... 1.7.2
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #10 on:
March 29, 2009, 04:06:30 PM »
ANNOUNCING VERSION 1.7.2
LIVE VERSION WITH MORE DYNAMIC(ISM) lol
TABLE NAME CAN NOW BE CHANGED IN CONFIG.PHP
SUGGESTIONS ON FUTURE CHANGES CAN BE MADE, PLEASE POST HERE!
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #11 on:
March 29, 2009, 05:33:37 PM »
1.9.0 DONE ANNOUNCING IT NOW
Smileys added, should work ok, have fun
pretty straight forward.....
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Dak
Administrator
Offline
Posts: 469
Creating a webpage for the guestbook.
«
Reply #12 on:
March 29, 2009, 06:21:45 PM »
OK, now we are going to add some information to help browsers interpret this document. This statement declares the document to be HTML 4.01 Transitional (English).
REMEMBER, IF YOU SEE *br* , it was supposed to say < those letters > and you should substitute < for *
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
There are many forms of html and most modern browsers can read them all with the correct information. HTML 4.01 Transitional is versatile, powerful and pretty much universally easily read by any modern browser.
4.01 Strict is even more browser friendly, but has less features. HTML 4.01 Frameset would be required if this document was part of a frameset. There are many other forms of html too.
This statement should be the very first thing on the page, at the very top.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Guestbook</title>
</head>
<body>
<?PHP
include ("GBupdate.php");
echo '*br**br**br**br**br*';
?>
</body>
</html>
Now we need to help the browser choose the correct character encoding. Remember, the computer is getting bytes(digital on and off signals) via its internet connection. It needs to convert this into something you can read.
For documents in English and most other Western European languages, the most widely supported encoding is ISO-8859-1, so thats what we will use.
To tell the browser this, we will add this line into the HEAD of the document.
The line we need to do this is
Content-Type text/html; charset=iso-8859-1
However, this line requires the co-operation of the server you are hosting the page on. As that doesn't always happen automatically (the server would have to be instructed), we are going to modify it a little to make this page more universal.
This modified version of this instruction is below. Its now simply being told that the character set isn't loaded until after the META tag, and prevents loading errors. Its not ideal, but its simple and easy and requires no other action.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
So now we have this...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Guestbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?PHP
include ("GBupdate.php");
echo '*br**br**br**br**br*';
?>
</body>
</html>
Now we'll add some tags. A Meta Tag is simply an information tag. It provides information not visible on the page displayed, but easily accessible by search engines which seek out meta tags and use descriptions and keywords to index your site.
These arent the sexiest of things, and you wont see anything on the page to show they are there, but they are vitally important if you want to attract visitors to your website.
The tag
<title> </title>
is a meta tag, and provides the information required to display your page title correctly on the titlebar of your browser, or on the tab you are viewing it on.
<meta name="description" content="This would be the short description under your Website title on the google search page. The following meta tag will contain keywords relevant to the page, to assist search engines in finding you"
<meta name="keywords" content="guestbook, freewebhosting, photography, music, editorial, australian" />
This one just tells robots ( search engine crawlers ) how to deal with the page.
<meta name="robots" content="index,follow" />
These will all go into the HEAD section, like so.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Guestbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Sign the daksters.com guestbook. Check out my photography, or argue with my political comment. Learn how to play Pogo Games better."
<meta name="keywords" content="computer help forum, guestbook, freewebhosting, photography, music, editorial, australian, pogo, pogobowl tutorials, pogo 7-10, pogo how to strike" />
<meta name="robots" content="index,follow" />
</head>
<body>
<?PHP
include ("GBupdate.php");
echo '*br**br**br**br**br*';
?>
</body>
</html>
This page is online at
http://daksters.com/guest
Check it regularly and watch it develop. Make suggestions about page layout and guestbook function.
Logged
Check out my personal website,
http://daksters.com
, for my opinions on life, the universe and everything!
I'm very opinionated, and I'd love to get some honest discussion happening about my views! I dare you!
Also featured are many galleries of my amateur photography, and an Australian Music Jukebox.
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #13 on:
March 31, 2009, 07:36:57 AM »
ANNOUNCING THE RELEASE OF VERSION 2.0.5
-------------------------------
<--- CHANGE LOG --->
-------------------------------
added email check (Removed, may add later)
added comments to updater...
ordered GB.php by number descending
Added sql injection prevention, this also allows for a lot more characters in the comments (' " ; : . ,) stuffs like that
added new comments to updater.php
new comments in index.php
new comments in GB.php
Work begins on the Admin page
Added simple login checker... configurable in the A_config.php page
Included the guestbook into the admin panel
moved admin script to root
Consolidated admin panel into one page (was three)
encorporated admin panel conifg into main config
centered guestbook in admin panel page
added comments to admin panel
scrapped project, restarted admin panel as an add in interface, takes admin username password and the number to delete all at once... seemed simpler
scrapped, keep reading, you'll see why
Unscrapped original work, else way i would have had to.. do a lot more...
split into two pages, this will allow for page one to have the admin logon, display the enhanced guestbook, and have a form for the delete and edit commands, and will then redirect to page two for the changes... The reason for this is because the first form, the logon was still on the page, so when you went to edit it, the first form was empty, and you were told you had the wrong username / password.... lol
finished login page
finished form to delete the entry and incorporated it into the last page
created script to delete an entry
added admin GB viewer columns for each type
added a limit to the Main guestbook, can be changed in config
added link to admin page
Fixed a bug in table creation (moved it but did not change placement
)
i think thats all i did....
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Dak
Administrator
Offline
Posts: 469
Re: Developing a Guestbook
«
Reply #14 on:
April 02, 2009, 04:42:04 PM »
Cool - I now have version 4 up and running at
http://daksters.com/guest
There was a slight delay in making a nice page to put it in while I waited for the guestbook to be finished, but now that it is, I'll get back to creating
The guestbook is currently visible in a draft form, but as I finalise the look I want it to have, I'll post instructions on what I did and how.
Excellent work Ryan, thank you!
Logged
Check out my personal website,
http://daksters.com
, for my opinions on life, the universe and everything!
I'm very opinionated, and I'd love to get some honest discussion happening about my views! I dare you!
Also featured are many galleries of my amateur photography, and an Australian Music Jukebox.
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #15 on:
April 04, 2009, 03:07:06 PM »
I have almost finished version 5, i have some testing i want to do first.
HOWEVER
version 5 is going to be the LAST non copyrighted version.... the admin panel is MORE than 1,000 lines long. that's huge.
so, after putting so much work in it, as i said, this is the last non copyrighted version, meaning that after this update, you will have to ask for the source code for the work, you will not be able to edit it
the pages will be... scrambled...
On the other hand, i will still offer a source download for certain uses. and the Guestbook will NOT have any normally visible ads. the ONLY two things im going to add are a copyright notice, and a link in the ADMIN page, it will NOT be visible to the public.
Like i said, after this release you can email me directly for the source.
if you have any questions, feel free to ask...
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #16 on:
April 05, 2009, 04:32:14 PM »
Ok, so i have decided not to scramble the code, i am going to copyright it, under one of the creative commons licenses, and as i add more functionality, it may become a more strict license.
Current license;
http://creativecommons.org/licenses/by-sa/3.0/
You may find that if you remove and or edit the license, the scripts may... disappear...
*wink
But as i said before, all rules may be bent, and as such, i am willing to remove the security features, and to allow full copyright licenses to people, depending on the cause.
Note that the script still does NOT display ANY ads except on the admin page, currently there is a link to both my page AND the page with the license...
note that the security is not FULLY implemented, but this is the basic building structure, pretty much the same as v5.0 except its copyrighted!
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Merlin33069
Administrator
Offline
Posts: 227
Re: Developing a Guestbook
«
Reply #17 on:
November 05, 2009, 02:25:13 PM »
sorry bout the lack of updating, im gonna take my newly learned php skillz to redo this thing, version 6 is gonna be pretty much a rewrite of the whole thing...
Logged
TimmCo Custom Computers
WWW.TimmCom.com
Pages:
[
1
]
PC Tips Forum
|
Tutorials
|
What is??? How to???
| Topic:
Developing a Guestbook
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Please read before posting
===> Forum Rules
===> Say Hello
===> Forum Instructions
===> Funny Stuff
===> Non Computer Chat
===> Brag Board
=> Forum feedback
-----------------------------
Computer Issues
-----------------------------
=> Anything Goes
=> Operating System Problems
===> Windows XP
===> Windows Vista
===> Windows Seven
=> Networking
=> Hardware
===> Installing new components
===> Diagnosing the problem
===> Video/Graphics cards
=> Software
===> Operating Systems
===> Internet Explorer
===> Firefox
=> CD or DVD burning, producing, converting
=> Email
=> Safety Issues
===> Computer & Internet Safety
===> Web Articles
-----------------------------
Computer Tips
-----------------------------
=> Great computer tips and tricks
===> Sneeky Keyboard Shortcuts
=> Free software
=> Computer Maintenance Tips
=> Computer Terminology
=> Computer Help Video's
-----------------------------
Tutorials
-----------------------------
=> What is??? How to???
-----------------------------
Website Chat
-----------------------------
=> Must See Websites
=> Youtube Videos
=> Developing Websites
===> Make money
===> Website hosting
Loading...