![]() |
#1 |
![]() Join Date: Mar 2018
Posts: 9
|
![]() Hi,
I need to put my login form into the center of page. Does any one can help how to do that? Thank's Joe |
![]() |
![]() |
![]() |
#2 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() make position relative and add margin left and right auto. that will float to the centre
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#3 |
![]() Join Date: Mar 2018
Posts: 9
|
![]() where can I find the position option?
thx |
![]() |
![]() |
![]() |
#4 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() if you are using css classes or id divs in th css sheet select position and a dialogue box will give you options to choose. will look like this for example .login{ position:relative; margin-left:auto; margin-right:auto;} and html ...........form here.........
if you are styling in line, you can add a style position click in the <div style="position:relative" > but css is better IMO
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#5 |
![]() Join Date: Mar 2018
Posts: 9
|
![]() This is my code, can you tell me where should I put the syntax ?
<?php require_once('Connections/bis_conn.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['username'])) { $loginUsername=$_POST['username']; $password=$_POST['password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "Menu.php"; $MM_redirectLoginFailed = "Gagal.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_bis_conn, $bis_conn); $LoginRS__query=sprintf("SELECT username, password FROM users WHERE username=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $bis_conn) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <style type="text/css"> body,td,th { color: #000; } body { background-color: #FFF; background-image: url(); } </style> <form name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <table width="500" border="1"> <tr> <th width="118" rowspan="4" scope="col"> </th> <th colspan="3" bgcolor="#FFFFFF" scope="col"><div align="center">LOGIN</div></th> </tr> <tr> <td width="139" bgcolor="#FFFFFF"><div align="center">Username</div></td> <td width="7" bgcolor="#FFFFFF"><div align="center">:</div></td> <td width="208" bgcolor="#FFFFFF"><label for="username"></label> <div align="center"> <input type="text" name="username" id="username"> </div></td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="center">Password</div></td> <td bgcolor="#FFFFFF"><div align="center">:</div></td> <td bgcolor="#FFFFFF"><label for="password"></label> <div align="center"> <input type="text" name="password" id="password"> </div></td> </tr> <tr> <td colspan="3" bgcolor="#FFFFFF"><div align="center"> <input type="submit" name="submit" id="submit" value="Submit"> </div></td> </tr> </table> </form> |
![]() |
![]() |
![]() |
#6 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() well problem is i would not use tables. i have made a page with a form for you so you can use the styles, and the form itself and change the styles to suit yourself.
Code:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <style type="text/css"> body { color: #000; } body { background-color: #FFF; } #content{ width:100%; position:relative;} #form{ width:300px; height:300px; border:#666 solid ; margin-left:auto; margin-right:auto;position:relative;} input{ float:left; width:90px; } label{float:left; width:70px;clear:left;} .button{ clear:both;background: #0F0; width:100px; height:40px; margin-left:90px;} </style> </head> <body> <div id="content"> <form id="form" name="form" method="POST" action="<?php echo $loginFormAction; ?>"> <h2>LOGIN</h2> <label >Username</label> <input type="text" name="username" id="username"> <label >password</label> <input type="text" name="password" id="password"> <input class="button" type="submit" name="submit" id="submit" value="Submit"> </form> </div> </body> </html>
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#7 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() i should mention i put it all in a content div, habit of mine incase i want to add sde bars etc. but it also becomes th eposition relative parent for the form
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#8 |
![]() Join Date: Mar 2018
Posts: 9
|
![]() ![]() ![]() ![]() |
![]() |
![]() |
![]() |
#9 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() you are welcome
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|