Jump to content

MichaelPerdaens

Members
  • Posts

    14
  • Joined

  • Last visited

MichaelPerdaens's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have this: <form ACTION="<?php echo $loginFormAction; ?>" METHOD="POST" name="login_form"> <fieldset class="account-info"> <label>Username<br/> <input type="text" style="<?php echo $color ['usercolor']?>" name="username"><br/> </label> <label>Password<br/> <input type="password" style="<?php echo $color ['passcolor']?>" name="password"><br/> </label> </fieldset> <fieldset class="account-action"> <input class="btn btn-primary" type="submit" value="Login"> <a class="registerbtn" href="register.php" >Register</a> </fieldset> </form> But i don't know how to send the color
  2. Yes Like this http://getbootstrap.com/css/#forms-control-validation
  3. It works! But how can I ensure that a red is invailed input frames
  4. I know but I don't know where I should put this or does it have no role? Ow i know srry my english is not good I have put it there but it don`t work
  5. Hey guys, i need help with my script i don't find how i can let display an login error please help. <?php require_once('../Connections/localhost.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; } } mysql_select_db($database_localhost, $localhost); $query_User = "SELECT * FROM users"; $User = mysql_query($query_User) or die(mysql_error()); function GetUser($naam, $password) { global $User; while($row = mysql_fetch_array($User)) { if($row["username"] == $naam) { if($row["password"] == $password) { return true; } } } return false; } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { } $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 = "../home/"; $MM_redirectLoginFailed = "index.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_localhost, $localhost); $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, $localhost) 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 ); } } ?> <?php include '../content/content.php'; include '../content/menu.php'; ?> <div class="content"> <div class="text"> <div class="contentbox"> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST' ) { $username = trim(htmlentities(mysql_real_escape_string($_POST['username']))); $password = trim(htmlentities(mysql_real_escape_string($_POST['password']))); if (!empty($username) && !empty($password)) { if(GetUser($username, $password)){ $_SESSION['username'] = $username; } } } ?> <?php if(isset($_SESSION["username"])) { echo "<center>ur alredy logged in</center><br><br><>"; }else{ ?> <?php if(isset($_SESSION['status'])) { echo $_SESSION['status']; unset($_SESSION['status']); } ?> <form ACTION="<?php echo $loginFormAction; ?>" METHOD="POST" name="login_form"> <fieldset class="account-info"> <label>Username<br/> <input type="text" name="username"><br/> </label> <label>Password<br/> <input type="password" name="password"><br/> </label> </fieldset> <fieldset class="account-action"> <input class="btn btn-primary" type="submit" value="Login"> <a class="registerbtn" href="register.php" >Register</a> </fieldset> </form> <?php } ?> <?php echo "<br/>"."<center>"; include '../content/copy.php'; include '../content/bg.php'; echo "</center>"; ?> </div> </div> </div> <video autoplay loop poster="../background/bg.jpg" id="bgvid"> <source src="../background/bg.webm" type="video/webm"> </video> <body> </body> </html> <?php mysql_free_result($User); ?>
  6. Ok my friend (game designer) have fixed ut but thanks for ur help guys
  7. Then you need to connect to your database and run an sql query to fetch the data you require Do you know how to do that? no can u help me with that?
  8. Hey i need help with my php script. it need to check the database but now it only check if its not empty but i don't know what i need to add i hope that us can help me <?php if ($_SERVER['REQUEST_METHOD'] == 'POST' ) { $username = trim(htmlentities(mysql_real_escape_string($_POST['username']))); $password = trim(htmlentities(mysql_real_escape_string($_POST['password']))); if (!empty($username) && !empty($password)) { $_SESSION['username'] = $username; echo "<br/> welcome ", $username; } else { echo "Please enter correct username or password"; } } else { echo "please Login"; } ?> <h1>Login</h1> <form ACTION="<?php echo $loginFormAction; ?>" METHOD="POST" name="login_form"> <label>Username:<br/></label> <input type="text" name="username"><br/> <label>Password:<br/></label> <input type="password" name="password"><br/> <input type="submit" value="Login"> <a href="../register">register</a> </form>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.