|
JoomlaWatch Agent |
|
Users| Most active users today from total of 109: | | Peerke, garikello, jakkrit, dayanand, andrew_saber, giakhanh, mohalb, carmachhh, fguyon, dfireablaze, phoeker, ozedfr, boho, ashish_php, blackie, amoluca, JDev, tinytim007, Pascale, mayas_salman | |
| 19.9% | | United States | | 17.9% | | India | | 9.3% | | Germany | | 5.5% | | Russian Federation | | 4.4% | | United Kingdom | | 4.3% | | France | | 4% | | Australia | | 3.8% | | Netherlands | | 3.8% | | Poland | | 3.7% | | Italy |
| Today: | 976 | | Yesterday: | 1402 | | This Week: | 5266 | | Last Week: | 8869 | | This Month: | 2378 | | Last Month: | 37593 | | Total: | 117058 |
|
HTML5, CSS3, SVG, tutorials
Freelance ColdFusion, Flex, PHP
Olejomalby, abstraktne obrazy
Camping Europe
WinAsm Studio
Vyšné Ružbachy
Sochy, Reštaurovanie
R.E.M.
RSS feed:
Statistics:
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>
|
Add comment







 Advertise Here - Promote your services and get the new customers from the community of webmasters / programmers visiting CodeGravity.com
|
 Outsource your project - Submit your project description with all the requirements to more than 600 freelancers from around the world for FREE.
|
HostMonster.com - best cheap Joomla Web hosting. Website joomlawatchdemo.com is hosted by them with domain for $6,95/mo.
|
FastDomain.com - Fast Domain hosting. Hostmonster alternative. Also for $6.95/month.
|
|
Freelance
Projects
Forum
Resources
|
Comments
It was very useful! Thanks!
It was very useful! Thanks!
RSS feed for comments to this post