i try to save the write message subject, content, writer, and time into mysql...by click the submit button
the html page will direct back to the same pageand save the data to mysql..
but it didn't work!
the program:
<html>
<head>
<title>·sªº³q§i</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<?php
echo $board;
$boa;
if(act==" ¦sÀÉ "){
require 'common.inc' ;
if (!empty($subject) and !empty($content) and !empty($staff) ){
mysql_connect($host,$user,$password);
mysql_select_db($database);
$content=nl2br($content);
$time=date("y-m-j H:i:s");
$str="INSERT INTO $board
(officer,subject,content,time)
VALUES
('$staff','$subject','$content','$time')";
mysql_query($str);
}}?>
<form name="form1" method="post" action="addmessage.php?board=paulmsg">
<br>
<table width="650" border="1" cellspacing="0" cellpadding="1">
<tr bgcolor="#999900" valign="middle">
<td colspan="2">
<div align="center">
<h1><font color="#FFFFCC">¥[¤J·sªº³q§i:</font></h1>
</div>
</td>
</tr>
<tr>
<td bgcolor="#FFFFCC">¥DÃD: </td>
<td>
<input type="text" name="subject" size="60">
</td>
</tr>
<tr>
<td bgcolor="#FFFFCC">¤º®e:</td>
<td>
<textarea name="content" rows="10" cols="75"></textarea>
</td>
</tr>
<tr>
<td bgcolor="#FFFFCC">¾û©m¦W:</td>
<td>
<input type="text" name="staff" size="50">
</td>
</tr>
</table>
<p> </p>
<p>
<input type="submit" name="act" value=" ¦sÀÉ ">
<input type="reset" name="reset" value=" «¼g ">
</p>
</form>
</div>
</body>
</html>
where is the error??
one thing ...can i use the submit button to triger a function in the page...
so that i no need to direct again.....