Register | Log in | Password |

365 projects | 71 services | 215 websites | 1073 freelancers | 2755 topics | advertise


Purchase JoomlaWatch:
30 day money-back guarantee
Read more...
9 EUR lifetime license
Buy Now

15 EUR lifetime license
Buy Now
(nofollow link from sponsors page)

Login:

23.4%United States United States
15.4%India India
7.3%Russian Federation Russian Federation
7.1%Colombia Colombia
6.1%Germany Germany
5.2%United Kingdom United Kingdom
4.4%Poland Poland
3.5%Netherlands Netherlands
3.1%France France
2.9%Canada Canada

Today: 158
Yesterday: 1413
This Week: 8221
Last Week: 10267
This Month: 4861
Total: 28175

Users

Most active users today from total of 8:
mlewis, Gomjerk, swaffel, specialone, leoaraujo, hanji, Denclub, fddeltenre
About JoomlaWatch:
JoomlaWatch is popular joomla visitor tracking and live stats component. It provides several features such as spam blocking, goals tracking, charts, nightly email reports, latest visit map, interactive HTML5 traffic flow graph and many other useful functionalities, which will help you to optimize your site.
RSS Feeds:

rss Freelance
rss Projects
rss Forum
rss Resources

Home

Simple guestbook in PHP and MySQL

Here is a code snippet of a simple guestbook in PHP and MySQL. It stores the data in the MySQL database and reads them with the PHP <?

/*
 * Example of simple guestbook in PHP & MySQL
 *
 * programmed by matto 2003, www.codegravity.com
 *
 */

$mysql_host = "www.codegravity.com";
$mysql_user = "matto";
$mysql_passwd = "";

$mysql_dbname = "codegravity";
$bodyname = "guest_book.php";
$db = @mysql_connect($mysql_host,$mysql_user,$mysql_passwd);
if (!$db) die("error!");

$result = @mysql_select_db($mysql_dbname,$db);
if (!$result) echo("error!");
mysql_query("create table guest_book (id int auto_increment primary key, name varchar(255), email varchar(255), message mediumtext) ",$db);
if (!isset($action))
{
    echo("
            <h3>Example of simple guestbook in PHP & MySQL</h3>
            <p>

            <form action='$bodyname' method=POST>
            name:<br>
            <input type=edit name=new_name>
            <p>

            email:<br>
            <input type=edit name=new_email>
            <p>
            message:<br>

            <textarea name=new_message></textarea>
            <p>
            <input type=hidden name=action value='record_insert'>

            <input type=submit value='submit record'>

            </form>
            <p>
            <font size=-1>Downloaded from <a href='http://www.codegravity.com'>www.codegravity.com</a> - internet database application development </font><hr>

            <p>
            ");
    $result = mysql_query("select * from guest_book",$db);
    while ($myrow = mysql_fetch_array($result))
    {
        echo("<b>name:</b> $myrow[1]<br> <b>email: </b>$myrow[2]<br> <b>message:</b> $myrow[3] <p>");

    }
    echo("
    ");
}

if ($action == "record_insert")
{
    $new_message = htmlspecialchars($new_message);
    $new_message = nl2br($new_message);
    $result = mysql_query("insert into guest_book values ('','$new_name','$new_email','$new_message') ",$db);

    if (!$result) echo("error!");
    header("location: $bodyname");
}
mysql_close($db);

?>  <p>
 
 

Comments  

 
+6 #1 ann 2007-09-05 17:42
It was very useful! Thanks!
Quote
 
 
+1 #2 Bbm 2008-03-16 01:09
Thanks!
It was very useful! Thanks!
Quote
 
 
+1 #3 Bill 2008-07-31 02:25
Thanks for article. Was useful.
Quote
 
 
+3 #4 Ricky 2008-08-11 12:43
:-) thanks for article.it was fery useful
Quote
 
 
+1 #5 ava 2009-04-05 11:33
Thanks for article!
Quote
 
 
+2 #6 madxerox 2009-05-15 10:29
very nice script !!! :-)
Quote
 
 
+1 #7 Andrew Pall 2009-09-29 14:24
Nice guest book.
Quote
 
 
+2 #8 Muppet 2009-10-28 01:48
it works on my site
Quote
 
 
+2 #9 Netq 2009-11-20 01:39
Thanks!
It was very useful! Thanks!
Quote
 
 
+2 #10 UniqueX 2010-06-12 07:21
thaks... ;-)
Quote
 
 
+2 #11 stomatolog kraków 2010-08-09 13:29
Thanks for article!
Quote
 
 
+2 #12 Makiss 2010-09-23 15:49
Thanks! very good!
Quote
 
 
+2 #13 Theme 2010-10-13 18:46
I'll try on my websites,thank you so much..

Could you compatible with gravatar?
Quote
 
 
+2 #14 sinemaz 2010-10-13 18:51
very good tnx dude. :-*
Quote
 

Add comment


Security code
Refresh


no license?

Recommended: (advertise)
Joomlawatch 1.2.17 Demo (PRO: 9/15 EUR)
Download Joomlawatch 1.2.17 (PRO: 9/15 EUR)

Rate this extension ...


Stay in touch:

New article about JoomlaWatch Live Stats feature: (link)
16 hours ago from web

Tested versions 1.2.12 FREE, 1.2.17 PRO, 1.2.18 BETA on Joomla 2.5 and older Joomla 1.5 - confirmed to work on both Joomla versions

Small installer fixes - added JoomlaWatch compatibility with Joomla 2.5

New article on JoomlaWatch Traffic Flow feature: (link) ... All features of JoomlaWatch will be documented this way.

Another minor fixes for version 1.2.17 and 1.2.18, added functionality to display only changed values in SEO report - important keyprases
2 weeks ago from web

Minor fixes for JoomlaWatch version 1.2.17 (language files), you can find the latest package in customer zone ((link)
2 weeks ago from web

If you'd like to help with testing of the latest 1.2.18 BETA with new features (Joomla/Wordpress),please add me on skype: matto3c.Thank you!
3 weeks ago from web

New article on JoomlaWatch SEO (Search Engine Optimization) report functionality - (link)

JoomlaWatch 1.2.18 is out now! Features new click heatmap feature, SEO report - how people find you on google, and many other improvements

Reorganized the menu items. Now you'll be able to easily find most requested links

JoomlaWatch 1.2.18 BETA now ready! Main features: - Heatmap integration - SEO reports - Anti-spam section visualization (link)

Fixed one issue: no unique visits recorded; PHP $_SERVER['REMOTE_ADDR'] doesn't always return remote IP address! using HTTP_X_FORWARDED_FOR

Christmas Special - 19% OFF from all licenses until 25th of December 2011

JoomlaWatch Heatmap functionality nearly done. Works with all client resolutions. Will be available in next version. (link)

Simple customer zone - (link) is now ready. Users who purchased the PRO version can now download newest version from there.

Because of the problems with payments and forwarding. We are using (link) service to deliver you the files after purchase.

Tracking Expenses from SMS android application is now published on android market :) and it's completely free !

(link) user information now protected with UserCrypt 1.1

UserCrypt version 1.1 released: Added query log, jos_users decryption on database interceptor plugin deactivation (link)

Timezone issue now fixed. Tested on canadian server which has hosting in the USA. Also module class suffix parameter now works for J1.7



Partners:
Freelance ColdFusion, Flex, PHP

Olejomalby, abstraktne obrazy

Camping Europe

WinAsm Studio

Vyšné Ružbachy

Sochy, Reštaurovanie

R.E.M.

Valid XHTML 1.0 Transitional

RSS feed:

Statistics:
Search Engine Genie Promotion Widget
Privacy policy | Advertise | Donate

Locations of visitors to this page


©2003-2010 Codegravity.com