<div class="col" style="border-right:none; color: #FFFFFF;">
<form id="form-search" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<span>
<span class="style2">Enter you email here</span>:
</span>
<input name="email" type="email" id="email" required/>
<input type="submit" value="subscribe" class="submit" style="height:30px;"/>
<?php
if($_POST['email']!="")
{
mysql_connect("localhost","","");
mysql_select_db("");
error_reporting(E_ALL && ~E_NOTICE);
$email=$_POST['email'];
$sql="INSERT INTO newsletter_email(email) VALUES ('$email')";
$result=mysql_query($sql);
if($result){
echo "You have been successfully subscribed.";
}
if(!$sql)
die(mysql_error());
mysql_close();
}
?>
</form>
</div>
After the user got subscribed, I want to replace my subscription form and display the echo statement.
This code is running totally fine and is very good too; just want some more advantage with it.. ..
it shows like this
But i want to show it like this 
my code now
<div class="col" style="border-right:none; color: #FFFFFF;">
<script>
var form = $('#form1');
$.ajax{
type:form.attr('method'),
url:form.attr('action'),
data:$("#form1").serialize(),
success: function(data){
if(data=="You have been successfully subscribed."){
$(".col").html("<div>Welcome</div>")
}
}
</script>
<form id="form1" method="post" action="index.php">
<span><span class="style2">Enter you email here</span>:</span>
<input name="email" type="email" id="email" required/>
<input type="submit" value="subscribe" class="submit" style="height:30px;"/>
<?php
if($_POST['email']!="")
{
mysql_connect("localhost","","");
mysql_select_db("");
error_reporting(E_ALL && ~E_NOTICE);
$email=$_POST['email'];
$sql="INSERT INTO newsletter_email(email) VALUES ('$email')";
$result=mysql_query($sql);
if($result){
echo "You have been successfully subscribed.";
}
if(!$sql)
die(mysql_error());
mysql_close();
}
?>
</form>
</div>