Jquery submit and live show
<p>I have a jquery submit problem. The problem is after submit the data didn't show automatically. So I must click refresh.</p>

<p>And this is my code so far :</p>

<p>PHP function to show the data</p>

<pre><code>function formatTweet($message,$date_post,$profile_pic,$full_name)
{
if(is_string($date_post)) $date_post=strtotime($date_post);

$message=htmlspecialchars(stripslashes($message));

return'
&lt;td&gt;
&lt;a href="#"&gt;&lt;img src="'.$profile_pic.'"/&gt;&lt;/a&gt;
&lt;div class="tweetTxt"&gt;
&lt;div class="profile_name"&gt;'.$full_name.'&lt;/div&gt;
&lt;div class="haps_post"&gt;'.$message.'&lt;/div&gt;
&lt;div class="post_time"&gt;'.relativeTime($date_post).'&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;tr&gt;';
}
</code></pre>

<p>PHP Function to save the data</p>

<pre><code>define('INCLUDE_CHECK',1);
require ("functions.php");
require ("config.php");

if(ini_get('magic_quotes_gpc'))
$_POST['inputField']=stripslashes($_POST['inputField']);
$_POST['username']=stripslashes($_POST['username']);
$date_post = date("Y-m-d G:i");

$_POST['inputField'] = mysql_real_escape_string(strip_tags($_POST['inputField']),$link);

$_POST['username'] = mysql_real_escape_string(strip_tags($_POST['username']),$link);

if(mb_strlen($_POST['inputField']) &lt; 1 || mb_strlen($_POST['inputField'])&gt;140)
die("0");

mysql_query("INSERT INTO messages SET message='".$_POST['inputField']."',username='".$_POST['username']."',date_post='$date_post'");

if(mysql_affected_rows($link)!=1)
die("0");

echo formatTweet($_POST['inputField'],$date_post,$_POST['username'],time());
</code></pre>

<p>Someone have an idea / suggestions ?
Thanks.</p>
