Jump to content

URGENT NEED HELP


kk580

Recommended Posts

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 !

 

 

Link to comment
https://forums.phpfreaks.com/topic/105698-urgent-need-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.