Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   Dreamweaver General (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=168)
-   -   form position (http://www.dreamweaverclub.com/forum//showthread.php?t=50970)

joekanan 12-13-2018 02:20 AM

form position
 
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

edbr 12-13-2018 04:05 AM

make position relative and add margin left and right auto. that will float to the centre

joekanan 12-14-2018 01:35 AM

where can I find the position option?

thx

edbr 12-14-2018 04:07 AM

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

joekanan 12-17-2018 07:01 AM

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">&nbsp;</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>

edbr 12-18-2018 01:29 AM

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>


edbr 12-18-2018 01:33 AM

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

joekanan 02-06-2019 02:31 AM

At least
 
:grin: at least the forum is activate again..thx a lot :):):

edbr 02-07-2019 01:12 AM

you are welcome


All times are GMT. The time now is 05:53 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com