kk580 Posted May 15, 2008 Share Posted May 15, 2008 I AM New to PHP Want to ask for every one idea i need to write a CONFIRM before putting my data into my MS databse Here is my code : Insert.html <html> <body> <head><font size=5>Please insert item that you want to add</head></font> <form action="insert.php" method="post"> <BR>Name: <input type="text" name="Name" /></br> <br>CLass NO: <input type="text" name="CLass No" /></br> <br>Age: <input type="text" name="Age" /> </br></br> <input type="Submit" VALUE=SUBMIT> <input type="Reset" VALUE=RESET> </form> <form action="http://localhost/front.html" ><input type="submit" value="Back To Main Page"></form> </body> </html> Insert.php <html> <head> <body> <?php $myServer = "ip address"; $myUser = "sa"; $myPass = ""; $myDB = "UBS"; //connection to the database $dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on $myServer"); //select a database to work with $selected = mssql_select_db($myDB, $dbhandle) or die("Couldn't open database $myDB"); //declare the SQL statement that will query the database $query = "INSERT INTO TABLE "; $query .= "(NAME, AGE, CLASSNO) VALUES "; $query .= "('$_POST[NAME]','$_POST[AGE]','$_POST[CLASSNO]')";; $result = mssql_query($query) or die("ERROR"); //close the connection mssql_close($dbhandle); ?> <form action="http://localhost/add.html" ><input type="submit" value="Back To Add Item Page"></form> <form action="http://localhost/front.html" ><input type="submit" value="Back To Main Page"> </form> </body> </head> </html> Everyone How can i make a confirm popup message or a confirm message to confirm that the TYPED DATE is correct to goto the databse ? Please HELp me THANKS A LOT ! Quote Link to comment Share on other sites More sharing options...
kk580 Posted May 15, 2008 Author Share Posted May 15, 2008 can anyone please help em ? Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted May 15, 2008 Share Posted May 15, 2008 what do you mean confirm? a javascript confirm that popups saying "do you wish to insert the data" i dont really see the point in that I would just use php form validation Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.