- Edited
It's difficult to assess from your code whether you understands HTML.
Where is your form tag?
Here is an example of what I think you are tyrying to do.
The form passes control to an action url adminpage.php which displays the inputs
<?php
session_start();
date_default_timezone_set("Europe/London");
?>
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<script type="text/javascript">
function subForm(){
subfrm = true;
if (name1Obj.value == ""){
alert("Please enter Name Part 1");
name1Obj.focus();
subfrm=false;
return;
}
if (name2Obj.value == ""){
alert("Please enter Name Part 2");
name2Obj.focus();
subfrm=false;
return;
}
if (pwordObj.value == ""){
alert("Please enter Password");
pwordObj.focus();
subfrm=false;
return;
}
if (subfrm==true){
// post to next page
formObj.action="adminpage.php";
formObj.submit();
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="adminpage.php" id="form1">
<div>
<span id="Label1" style="display:inline-block;height:16px;width:50px;left: 305px; position: absolute;
top: 109px; padding-left: 0px; padding-bottom: 0px; margin: 0px; vertical-align: middle; text-indent: 0px; padding-top: 0px; text-align: left;">Part 2</span>
<span id="Label1" style="display:inline-block;height:16px;width:173px;left: 73px; position: absolute;
top: 109px; padding-left: 0px; padding-bottom: 0px; margin: 0px; vertical-align: middle; border-top-style: none; text-indent: 0px; padding-top: 0px; border-right-style: none; border-left-style: none; letter-spacing: normal; text-align: left; border-bottom-style: none;">Username Part 1</span>
<input name="username1" type="text" value="" maxlength="16" id="username1" tabindex="1" style="width:100px;left: 190px; vertical-align: middle;
direction: ltr; text-indent: 3px; letter-spacing: normal; position: absolute;
top: 104px; height: 20px; text-align: left; z-index: 105;" />
<input name="username2" type="text" value="" maxlength="16" id="username2" style="width:100px;left:350px; vertical-align: middle;position: absolute;
top: 104px; height: 20px; text-align: left;" />
<input name="pword" type="text" value="" maxlength="1000" id="pword" tabindex="2" style="width:100px;left: 190px; vertical-align: middle;
direction: ltr; text-indent: 3px; letter-spacing: normal; position: absolute;
top: 132px; height: 20px; text-align: left; z-index: 103; bottom: 305px;" />
<button id="loginButton" onclick="javascript:subForm();return false;" style="left: 190px; position: absolute; top: 170px; z-index: 107; width:200px; height:25px;">Log in</button>
<span id="Label2" style="display:inline-block;height:16px;width:71px;left: 73px;
vertical-align: middle; text-indent: 0pt; letter-spacing: normal; position: absolute;
top: 135px; text-align: left; z-index: 104;">Password</span>
</div>
</form>
<script type="text/javascript">
formObj = document.getElementById("form1");
name1Obj = document.getElementById("username1");
name2Obj = document.getElementById("username2");
pwordObj = document.getElementById("pword");
</script>
</body>
</html>
Heres tha admipage.php
<?php
session_start();
date_default_timezone_set("Europe/London");
$username1 = "NOT SET";
$username2 = "NOT SET";
$password = "NOT SET";
$contlen = $_SERVER['CONTENT_LENGTH'];
if ($contlen > 0){
$username1 = $_REQUEST['username1'];
$username2 = $_REQUEST['username2'];
$password = $_REQUEST['pword'];
}
?>
<!DOCTYPE html>
<html>
Admin Page
<table>
<tr><td>User name Part 1</td><td><?=$username1 ?></td></tr>
<tr><td>User name Part 2</td><td><?=$username2 ?></td></tr>
<tr><td>Password</td><td><?=$password ?></td></tr>
<tr><td colspan="2">Do what you need to do with this data</td></tr>
</table>
</html>
I suggest you master this task first and then add your database access code and work on that.