logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Dreamweaver General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 12-13-2018, 02:20 AM   #1
joekanan
 
Join Date: Mar 2018
Posts: 9
Default 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
joekanan is offline   Reply With Quote
Old 12-13-2018, 04:05 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,214
Default

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
edbr is offline   Reply With Quote
Old 12-14-2018, 01:35 AM   #3
joekanan
 
Join Date: Mar 2018
Posts: 9
Default

where can I find the position option?

thx
joekanan is offline   Reply With Quote
Old 12-14-2018, 04:07 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,214
Default

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
edbr is offline   Reply With Quote
Old 12-17-2018, 07:01 AM   #5
joekanan
 
Join Date: Mar 2018
Posts: 9
Default

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>
joekanan is offline   Reply With Quote
Old 12-18-2018, 01:29 AM   #6
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,214
Default

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
edbr is offline   Reply With Quote
Old 12-18-2018, 01:33 AM   #7
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,214
Default

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
edbr is offline   Reply With Quote
Old 02-06-2019, 02:31 AM   #8
joekanan
 
Join Date: Mar 2018
Posts: 9
Smile At least

at least the forum is activate again..thx a lot :
joekanan is offline   Reply With Quote
Old 02-07-2019, 01:12 AM   #9
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,214
Default

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
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:02 AM.


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