shrimp
-
Posts
9 -
Joined
-
Last visited
Never
Posts posted by shrimp
-
-
redarrow thanks. solve it oredi... the thing is just 'submit' need to changed to 'Submit' hiks.. hehehe THANKS A LOT BRO! :)
-
hello redarrow. do u hav im? if u dun mind :)
-
oredi fixed and try it out bro.. still no clue y this still no data insert.
if u dun mind, below i zip my file n screenshot of phpmyadmin mysql table..
http://geocities.com/butter_punk/guestbook.zip
Database name : test
Table : guestbook
username : root
no password.
Many thanks for the help n time bro.. -
oredi try bro but still. the msg is.. NO DATA INSERTED hehehe
this is my ugly form
[quote]
<html>
<link href="style.css" rel="stylesheet" type="text/css" />
<body>
<p>
<form method="POST" action="addguestbook1.php">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="145" class="halo">Name</td>
<td width="355" class="halo"> :
<input name="name" type="text" id="name">
</td>
</tr>
<tr>
<td class="halo">Email</td>
<td class="halo"> :
<input name="email" type="text" id="email">
</td>
</tr>
<tr>
<td class="halo">Comments</td>
<td class="halo"> :
<textarea name="comment" cols="40" id="comment"></textarea>
</td>
</tr>
<tr>
<td> </td>
<td class="halo">
<label>
<input type="submit" name="Submit" value="submit" >
</label>
</td>
</tr>
</table>
</form>
</p>
</body>
</html>
[/quote]
sorry trouble u bro -
its just says ERROR
which is i tink at the last if else bro..
::) -
hi redarrow thanks for helping me
btw i did change the handler to this
[quote]
<html>
<link href="style.css" rel="stylesheet" type="text/css" />
<body>
<p>
<?php
$db=mysql_connect("localhost","root","")or die("GAK BISA KONEK");
mysql_select_db("guest",$db);
$name=addslashes($_POST['name']);
$email=addslashes($_POST['email']);
$comment=addslashes($_POST['comment']);
$datetime=addslashes($_POST['datetime']);
$datetime=date("y-m-d h:i:s"); //date time
if($_POST['submit']){
$sql="INSERT INTO guestbook(`name`, `mail`, `comment`, `datetime`)VALUES('$name', '$email', '$comment', '$datetime');";
$result=mysql_query($sql);
}
//check if query successful
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='viewguestbook.php'>View guestbook[/url]"; // link to view guestbook page
}
else {
echo "ERROR";
}
mysql_close();
?>
</p>
</body>
</html>
[/quote]
but its error. when i press submit
btw i dunno what u mean uppercase post. i did put post method. thanks a lot for the explanation mate.
God Bless -
anyone can help ? anyway this is what i type on,
this is the form
[quote]
<html>
<link href="style.css" rel="stylesheet" type="text/css" />
<body>
<table width="400" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td class="halo"><strong>Test Sign Guestbook </strong></td>
</tr>
</table>
<table width="400" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td class="halo"><strong><a href="viewguestbook.php">View Guestbook</a> </strong></td>
</tr>
</table>
<form id="form2" name="form2" method="post" action="addguestbook.php">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" class="halo">
<tr>
<td width="147" class="halo">Name</td>
<td width="353" class="halo"> :
<label>
<input name="name" type="text" id="name" />
</label>
</td>
</tr>
<tr>
<td class="halo">Email</td>
<td class="halo"> :
<input name="email" type="text" id="email" />
</td>
</tr>
<tr>
<td class="halo">Comments</td>
<td class="halo"> :
<label>
<textarea name="comment" cols="40" id="comment"></textarea>
</label>
</td>
</tr>
<tr>
<td> </td>
<td class="halo">
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
[/quote]
this is the handler :
[quote]
<html>
<link href="style.css" rel="stylesheet" type="text/css" />
<body>
<p>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="guest"; // Database name
$tbl_name="guestbook"; // Table name
echo "$name";
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect server ");
mysql_select_db("$db_name")or die("cannot select DB");
$datetime=date("y-m-d h:i:s"); //date time
$sql="INSERT INTO $tbl_name(name, email, comment, datetime)VALUES('$name', '$email', '$comment', '$datetime');";
$result=mysql_query($sql);
//check if query successful
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='viewguestbook.php'>View guestbook</a>"; // link to view guestbook page
}
else {
echo "ERROR";
}
mysql_close();
?>
</p>
</body>
</html>
[/quote]
anyone can help me with the error :( -
hello,
im nubi on php heheh.. and my st try is this guestbook http://sildeyna.trap17.net/guestbook.php
the problem is when we input the name email n comment. it wont popup on the handler. and as the results it inputs nothing on the database. i dunno because of what. anyone help me pleasee :((( thank u so much
PHP Form help
in PHP Coding Help
Posted