Click here to Skip to main content
15,914,924 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After inserting the data into database,i want to create the alert box>Please give some suggestions or post some code
Posted
Comments
Rajesh Anuhya 2-Feb-12 3:35am    
What you are excepting exactly, where you are getting problem?
--RA

PHP
// refer it , i think u will get the solution........
if(isset($_GET["submit"]))
 {
       $number=$_POST['id'];
       $name=$_POST['name'];
       $userid=$_POST['userid'];
       $password =$_POST['password'];
       $address = $_POST['address'];
       $phone = $_POST['phone'];
       $email=$_POST['email'];

       $insertsql = "INSERT INTO userinfo (name,userid,password,address,phone,email)
       values('$name','$userid','$password','$address','$phone','$email')";

       $insertrs = mysql_query($insertsql) or die(mysql_error());

       if($insertrs)
     {
        echo "<b>Form has been submited </b>";    <= this is a alert msg
       }
       else { echo " <b>Error occured </b>";}
  }
 
Share this answer
 
after successful insertion you can use JS alert
like

PHP
echo "<script type="text/javascript">alert('Confirmation')</script>";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900