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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.