Re: combobox [message #177314 is a reply to message #177313] |
Thu, 08 March 2012 13:27 |
ecu_jon
Messages: 3 Registered: March 2012
Karma:
|
Junior Member |
|
|
here is page5
there is the first 6 lines that set up stuff to connect to db.
the 4 if isset's get the Post variables from inputpage(above)
then the mysql insert into db command.
and it looks like it mangled the longer lines. the sql statement will
probably come out weird.
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
<?php
$Status = $_POST["Status"];
$host="localhost"; // Host name
$username="user"; // Mysql username
$password="password"; // Mysql password
$db_name="name"; // Database name
$tbl_name="name"; // Table name
mysql_connect("$host", "$username", "$password")or die("cannot
connect"); //sql connection to db
mysql_select_db("$db_name")or die("cannot select DB"); //select db sql
command
if(isset($_POST['Client'])) $Client = $_POST['Client']; //check if
value from POST, sev variable to value
if(isset($_POST["Site"])) $Site = $_POST["Site"];
if(isset($_POST["Uname"])) $Uname = $_POST["Uname"];
if(isset($_POST["Uid"])) $Uid = $_POST["Uid"];
if(isset($_POST["Password"])) $Password = $_POST["Password"];
mysql_query("INSERT INTO client
(client, site, user, userid, password, status) VALUES('$Client',
'$Site', '$Uname', '$Uid', '$Password', '$Status') ")
or die(mysql_error()); //insert above variables into db
echo "user added".$Client;
mysql_close();
?>
<br><br>
<a href="./login_success.php">Back Home</a>
</body>
</html>
|
|
|