Simple GUESTBOOK problem
Posted: Fri Mar 14, 2008 6:06 am
Everah | Please use [php], [code] and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
greetings! I installed XAMPP on my computer and when i tried creating a php script to view the database it shows the result perfectly.
But when I tried creating a simple guestbook program it keeps showing the same error message "WRONG"
below are the codes of my program
SIGNUP.PHP
SIGNUP_DB.PHP
dbconnect.php
any help would be appreciated
thanks!
Everah | Please use [php], [code] and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
greetings! I installed XAMPP on my computer and when i tried creating a php script to view the database it shows the result perfectly.
But when I tried creating a simple guestbook program it keeps showing the same error message "WRONG"
below are the codes of my program
SIGNUP.PHP
Code: Select all
<form method="post" action="signup_db.php">Name : <input type="text" name="frm_name"><br>E-mail : <input type="text" name="frm_email"><br>Tel No : <input type="text" name="frm_telno"><br>Message : <input type="text" name="frm_message"><br><input type="submit" name="frm_submit" value="POST GUESTBOOK">SIGNUP_DB.PHP
Code: Select all
<?php
include("dbconnect.php");
if ($frm_submit=="POST GUESTBOOK")
{
$query = " insert into gb_entry
(gb_name,gb_email,gb_telno,gb_message) values
('".mysql_real_escape_string($frm_name)."','".
mysql_real_escape_string($frm_email)."','".
mysql_real_escape_string($frm_telno)."','".
mysql_real_escape_string($frm_message)."')"
;
mysql_query($query) or
die(mysql_error());
?>
<h2>entry added</h2>
<?php
}
else
{
echo "WRONG";
}
?>dbconnect.php
Code: Select all
<?php
mysql_connect("127.0.0.1","root","november") or
die("query=$query\nerror=".mysql_error());
mysql_select_db("guestbook") or
die ("could not select database");
?>any help would be appreciated
thanks!
Everah | Please use [php], [code] and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.