Jump to content

Adamhull1

New Members
  • Posts

    3
  • Joined

  • Last visited

Adamhull1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello I am struggling to align my php form using my CSS and need help the form is currently floating on the right and I need it in the centre any help would be great full CSS body { margin: 0; padding: 0; font-size: 12px; font-family: "Open Sans"; background: url(http://w3theory.com/clients/BO/images/login/background_repeat.jpg) repeat; }.wrap { width: 100%;}.row { margin: 0 auto; width: 832px;}.small_row { margin: 0 auto; width: 750px;}#outer { min-height: 600px; background: url(http://w3theory.com/clients/BO/images/login/background_x_repeat.png) repeat-x; }/* Top Bar Styles */#top_bar { height: 65px; background: url(http://w3theory.com/clients/BO/images/login/top_bar.png) repeat-x; }#top_bar .login_input { float: left; margin: 6px 15px 0 0; width: 182px; height: 42px; background: url(http://w3theory.com/clients/BO/images/login/login_input.png) no-repeat; }#top_bar .login_input .none { margin: 7px 0 0 7px; width: 170px; height: 22px; color: #d9d4b5; line-height: 22px; background: none; border: none; outline: none; font-size: 11px;}#top_bar .log_in { float: left; margin: 6px 15px 0 0; cursor: pointer; outline: none; width: 47px; height: 42px; border: none; background: url(http://w3theory.com/clients/BO/images/login/login_btn.png) no-repeat; }#top_bar .log_in:hover { opacity: .65;}#top_bar .text { float: left; line-height: 52px; color: #d9d4b5;}#top_bar .text a { color: #d9d4b5; text-decoration: none; font-size: 11px;}#top_bar .text a:hover { color: #fff;}/* Header Styles */#header {}#header #logo { float: left; margin: 25px 0 0 0; width: 348px; height: 98px; background: url(http://w3theory.com/clients/BO/images/login/logo.png) no-repeat; }#header #menu { float: left; margin: 20px 0 0 30px; width: 189px;}#header #menu a { display: block; width: 189px; height: 32px; color: #d9d4b5; line-height: 32px; text-align: center; text-shadow: 1px 0 1px #000; font-weight: bold; text-decoration: none; background: url(http://w3theory.com/clients/BO/images/login/menu_btn.png) no-repeat; }#header #menu a:hover { opacity: .85;}#header #news_box { position: absolute; margin: 30px 0 0 585px; width: 232px; height: 283px; background: url(http://w3theory.com/clients/BO/images/login/news_box.png) no-repeat; }#header #news_box p { padding: 25px 35px; color: #dbd6b8; font-size: 12px; -webkit-transform: rotate(2deg); -moz-transform: rotate(2deg); -ms-transform: rotate(2deg); -o-transform: rotate(2deg); transform: rotate(2deg);}#header #news_box p span.title { font-weight: bold; font-size: 20px; line-height: 34px; display: block;}#header #news_box p span.date { color: #c17830; font-size: 12px; line-height: 40px; display: block;}/* Content Styles */#content_box { }#content_box .top { height: 55px; background: url(http://w3theory.com/clients/BO/images/login/content_box_bg_01.png) no-repeat; }#content_box .middle { min-height: 250px; background: url(http://w3theory.com/clients/BO/images/login/content_box_bg_02.png) repeat-y; }#content_box .middle .pad { padding: 15px 70px 10px 70px;}#content_box .middle h2 { margin: 0; text-indent: 15px; text-transform: uppercase; font-size: 35px; line-height: 30px; color: #29271d; border-left: 15px solid #29271d;}#content_box .middle p.first_paragraph { width: 550px; line-height: 22px; color: #29271d; font-size: 11px;}#content_box .middle p.second_paragraph { line-height: 22px; color: #574221; font-size: 11px;}#content_box .middle a.enlist { margin: 10px 0; display: block; text-indent: 25px; font-size: 30px; width: 677px; height: 105px; line-height: 105px; text-transform: uppercase; font-weight: bold; text-decoration: none; color: #88724f; background: url(http://w3theory.com/clients/BO/images/login/enlist_now_btn.png) no-repeat; }#content_box .middle a.enlist:hover { color: #42341f;}#content_box .bottom { height: 61px; background: url(http://w3theory.com/clients/BO/images/login/content_box_bg_04.png) no-repeat; }/* Footer Styles */#footer { padding: 25px 0; text-align: center; color: #231d13; font-size: 11px; line-height: 22px;}#footer span { font-weight: bold; font-size: 30px; line-height: 34px;}#footer a { color: #231d13; text-decoration: none;}#footer a:hover { color: #dfdabf; text-decoration: underline;}.spacer { clear: both;}[\code]Register page[code=auto:0]<?phpsession_start();include 'dbcon.php';include 'classes.php';$time = date(F." ".d.", ".Y." ".g.":".i.":".sa,time());function badmailhost($str) { $badhosts = file("mailhosts.txt"); foreach($badhosts as $mailhosts) $mailhosts = str_replace(array("\r", "\n", "()", " "), "", trim($mailhosts)); return true;}function mres($str) { return mysql_real_escape_string($str);}$classes = array( 'Mastermind', 'Assassin', 'Bodyguard', 'Smuggler', 'Thief');if(isset($_POST['submit'])) { $username = trim(mres($_POST['newname'])); $signuptime = time(); $password = hash("md5", trim(mres($_POST['newpass']))); $password2 = hash("md5", trim(mres($_POST['newpassagain']))); $email = isset($_POST['email']) && is_string($_POST['email']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) ? $_POST['email'] : null; $checkuser = mysql_query("SELECT `id` FROM `grpgusers` WHERE `username` = '$username'"); if ($_SESSION['AntiSpamImage'] != $_REQUEST['anti_spam_code']) { // set antispam string to something random, in order to avoid reusing it once again $_SESSION['AntiSpamImage'] = rand(1,9999999); $message .= "<font color='red'><b>The verification code you entered is invalid.</br>";} if(mysql_num_rows($checkuser)) $message .= "<div>I'm sorry but the username you chose has already been taken. Please pick another one.</div>"; if(strlen($username) < 4 or strlen($username) > 20) $message .= "<div>The username you chose has " . strlen($username) . " characters. You need to have between 4 and 20 characters.</div>"; if(strlen($password) < 4 or strlen($username) > 20) $message .= "<div>The password you chose has " . strlen($password) . " characters. You need to have between 4 and 20 characters.</div>"; if($password != $password2) $message .= "<div>Your passwords don't match. Please try again.</div>"; if(empty($email)) $message .= "<div>The e-mail address you entered was invalid.</div>"; $_POST['class'] = isset($_POST['class']) && ctype_alpha($_POST['class']) && in_array($_POST['class'], $classes) ? $_POST['class'] : null; if(empty($_POST['class'])) $message .= "<div>The class you chose was not valid</div>"; if(!isset($message)) { $result = mysql_query("INSERT INTO `grpgusers` (`ip`, `username`, `password`, `email`, `signuptime`, `lastactive`, `class`) VALUES ('" . mres($_SERVER['REMOTE_ADDR']) . "', '$username','$password', '$email', $signuptime, $signuptime, '" . $_POST['class'] . "')"); $_POST['referer'] = isset($_POST['referer']) && ctype_digit($_POST['referer']) ? abs(@intval($_POST['referer'])) : null; if(!empty($_POST['referer'])) mysql_query("INSERT INTO `referrals` (`when`, `referrer`, `referred`) VALUES ($signuptime, " . $_POST['referer'] . ", '" . $username . "')"); // SMF Integration // The following ___VALUE___'s, enter the relevant details for SMF database//$link = mysql_connect("localhost", "dylan_game", "demo123");mysql_select_db("dylan_game", $link) or die(mysql_error());$passwd = ($password) . $_POST['password'];mysql_query("INSERT INTO dylan_game.`smf_members` (`member_name`,`date_registered`,`real_name`,`email_address`,`passwd`) VALUES ('{$username}',unix_timestamp(),'{$username}','{$_POST['email']}', '{$passwd}')");mysql_query("UPDATE `smf_settings` SET `value`='{$username}' WHERE `variable`='latestRealName'");mysql_query("UPDATE `smf_settings` SET `value`=`value`+1 WHERE `variable`='totalMembers'");mysql_close($link);// SMF Integration // echo Message('<font color="red"><b>Thank you for signing up with Battle Ops, We have sent an email to verify your account. Redirecting to login page in 5 seconds.<!-- Game-Advertising-Online.com Action Tracker --><img src="http://www.game-advertising-online.com:81/ats.php?aid=3715" width="1" height="1"> <meta http-equiv="refresh" content="5;url=index.php">'); if ($_POST['referer'] != ""){ $result= mysql_query("INSERT INTO `referrals` (`when`, `referrer`, `referred`)". "VALUES ('$signuptime', '".$_POST['referer']."', '".$username."')"); } // Let's mail the user! $subject = "Welcome to Battle Ops $username"; $message = "Dear $username, your Battle Ops details! Upon logging in for the first time, your user account will be activated, you can then login with the following details: These Details will be THE SAME for our forums as well. Username: $username Password: $password Thanks! Battle Ops staff. Enjoy your game. This is an automated response, please do not reply!"; mail($_POST["email"], $subject, $message, "From: Battle Ops Account<noreply@wisecrime.com>"); die(); }}if(isset($message)) { echo Message($message);}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Battle Ops - The Game</title><link type="text/css" rel="stylesheet" href="http://www.w3theory.com/clients/BO/login.css" /><body><div id="outer" > <div id="header" class="small_row"> <div id="logo"></div> <div id="menu"> <a href="home.php">HOMEPAGE</a> <a href="register.php">REGISTER</a> <a href="contact.php">CONTACT US</a> <a href="http://www.votelistedgames.com/index.php?page=in&id=11">Vote For Us!</a> </div> <div id="news_box"><center> <table float="left" width='100%' border='0' align='center' cellpadding='0' cellspacing='0'><form name='register' method='post' action='register.php'></div> <input type='text' name='newname' placeholder='username' /><td><font size='2' face='verdana'><tr> <input type='password' name='newpass' placeholder='password'/> </font><font size='2' face='verdana'><font size='2' face='verdana'><input type='password' name='newpassagain' placeholder='confirm password' /> </font> <font size='2' face='verdana'><input type='text' name='email' placeholder='email' /></font><tr> <font size='2' face='verdana'> <select name='class' type='dropdown'> <?php foreach($classes as $opt) printf("<option value='%1\$s'>%1\$s</option>", $opt); ?> </select> <td><input type='hidden' name='referer' value='<?php echo isset($_GET['referer']) && ctype_digit($_GET['referer']) ? abs(@intval($_GET['referer'])) : null; ?>' /> <font size='2' face='verdana'><br /><tr> <center><img src="antispam.php"/> <tr> <input type='text' name='anti_spam_code' /> <tr><input type='submit' name='submit' value='Register' /> </center> </td> </tr> [\code]
  2. Hello it is my first time at the forum I am trying to make a new layout for my website but I can not get the tables under my login box to align next to each other all the same size any help? Then code is <?phpsession_start();include_once"includes/db_connect.php";if (strip_tags($_GET['logout']) == "yes"){session_destroy();}elseif (isset($_SESSION['username'])){header("Location: logged_in.php");exit();}if ($_POST['Submit'] && strip_tags($_POST['username']) && strip_tags($_POST['password'])){$username = addslashes(strip_tags($_POST['username'])); $password = addslashes(strip_tags($_POST['password']));$ip = $REMOTE_ADDR;$ud=mysql_num_rows(mysql_query("SELECT * FROM users"));///check INFO$sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1' LIMIT 1"); $login_check = mysql_num_rows($sql); $inf = mysql_fetch_object($sql); if ($login_check == "0"){echo "<body bgcolor=#666666>You Have Typed an Incorrect Username or Password";}elseif ($login_check != "0"){if ($login_check > "0"){if ($inf->status == "Dead"){include_once"dead.php";exit();}if ($inf->status == "Banned"){$encoded=md5(strtolower($username));header("Location: banned.php?banned=$username&encoded=$encoded"); exit();} session_register('username'); $_SESSION['username'] = $inf->username; $timestamp = time()+60; mysql_query("UPDATE users SET online='$timestamp' WHERE username='$username'");mysql_query("UPDATE users SET l_ip='$ip' WHERE username='$username'"); header("Location: logged_in.php"); } else { $message= "You could not be logged in.<br />"; }}}///////MONEY IN GAME AND PER USER$result11111 = mysql_query("SELECT money, bank FROM users WHERE userlevel='0' AND status='Alive'"); $moneytot = 0; while($row=mysql_fetch_array($result11111)){ $moneytot+=$row[0]+$row[1]; } $nums=mysql_num_rows($result11111); $per_user = round($moneytot / $nums);$ud=mysql_num_rows(mysql_query("SELECT * FROM users"));///END////SITE STATS$site=mysql_fetch_object(mysql_query("SELECT * FROM site_stats WHERE id='1'"));////END////FORUM TOPICS$totaltopics = mysql_num_rows(mysql_query("SELECT id FROM topics"));//?END/////USERS DEAD$dead= mysql_num_rows(mysql_query("SELECT username FROM users WHERE status = 'Dead' AND modkill = '0'"));$banned= mysql_num_rows(mysql_query("SELECT username FROM users WHERE status = 'Banned'"));/////TOTAL ATTEMPTS$attempts= mysql_num_rows(mysql_query("SELECT id FROM attempts WHERE outcome = 'Survived' OR outcome = ''"));///?END$result11111swiss = mysql_query("SELECT money FROM swiss"); $moneyswiss = 0; while($rowswiss=mysql_fetch_array($result11111swiss)){ $moneyswiss+=$rowswiss[0]; }?> <html><head><link rel="shortcut icon" href="favicon.ico.png"><title>Way Of The Mafia</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="includes/in.css" rel="stylesheet" type="text/css"><style type="text/css"><!--A:link, { COLOR:#999999; font-family:"Arial", serif; FONT-WEIGHT:bold;font-size:12px; TEXT-DECORATION:none}body { background-attachment: fixed; background-image: url(images/index/loginbg.jpg); background-position: bottom right;}.style4 {font-size: 18px; font-color: #FFFFFF; }.style9 {color: #000000}.style13 {color: #FFFFFF}.style14 { color: #000000; font-weight: bold; font-family: Geneva, Arial, Helvetica, sans-serif;}.style16 {color: #CCCCCC}.style17 {color: #0099FF}.style18 {color: #00FF00}.style19 {color: #FF0000; }<style type="text/css">.button { -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; box-shadow:inset 0px 1px 0px 0px #ffffff; background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9) ); background:-moz-linear-gradient( center top, #f9f9f9 5%, #e9e9e9 100% ); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9'); background-color:#f9f9f9; -webkit-border-top-left-radius:0px; -moz-border-radius-topleft:0px; border-top-left-radius:0px; -webkit-border-top-right-radius:0px; -moz-border-radius-topright:0px; border-top-right-radius:0px; -webkit-border-bottom-right-radius:0px; -moz-border-radius-bottomright:0px; border-bottom-right-radius:0px; -webkit-border-bottom-left-radius:0px; -moz-border-radius-bottomleft:0px; border-bottom-left-radius:0px; text-indent:0; border:1px solid #dcdcdc; display:inline-block; color:#666666; font-family:Impact; font-size:15px; font-weight:bold; font-style:normal; height:40px; line-height:40px; width:100px; text-decoration:none; text-align:center; text-shadow:1px 1px 0px #ffffff;}.button:hover { background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9) ); background:-moz-linear-gradient( center top, #e9e9e9 5%, #f9f9f9 100% ); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9'); background-color:#e9e9e9;}.button:active { position:relative; top:1px;}.table1 { width:auto; max-width:100%; display:inline-block; float:none;}.table2 { width:auto; max-width:100%; display:inline-block; float:left;}input, select, textarea{ color: #ffffff;}</style></style></head><? $timenow=time();$select =mysql_query("SELECT * FROM users WHERE online > '$timenow' ORDER by id");$num = mysql_num_rows($select); ?> <p align="center"><img src="images/banner.jpg"><BR><BR><table bgcolor=black width="20%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor=black class="thinline"><tr><td><center>Login</td></tr> <tr><td><form action='index.php' method='post'> <div align="center"><br /><span class="style4"> <font color=#FFFFFF>Username: <input name="username" class="thinline" type="text" id="username" value="<?php if (strip_tags($_GET['l'])){ echo "$l"; } ?>" size="15" maxlength="40"> </div> <div align="center"> <span class="style4"> Password: <font color="white"><input name="password" type="password" class="thinline" id="password2" value="<?php if (strip_tags($_GET['pw'])){ echo "$pw"; } ?>" size="15" maxlength="40"> </span></div><center><input name="Submit" colspan="4" type="Submit" id="Submit" value="Login" class="button"><br /><tr><p align="center"> <a href="register.php"><img src="images/index/reglink.png" alt="register" ismap></a> <a href="lost.php"><img src="images/index/lplink.png" ismap></a><br /><br /></p></td></tr> </table> <label></label> <div align="center"> <p> </div> </form><br><br><br><table class=table2><center>&nbsp&nbsp&nbsp<td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><table bgcolor=black width=25% class="table1"><td></td><table bgcolor=black class="table2" height=33%><tr class="thinline"><td colspan=2> Last 5 Registered</td> </tr> <tr class=table> <td class="subhead" width="109">Username</td> </tr> <? $c=mysql_query("SELECT * FROM users ORDER BY id DESC LIMIT 5"); while($d=mysql_fetch_object($c)){ echo "<tr><td align=center>$d->username</td></tr>"; } ?><table bgcolor="black" class="table2" height=33%><tr align="center" class="thinline"><td colspan=2> Last 5 Killed</td> </tr> <tr class=table> <td class="subhead" width="109">Username</td> </tr> <? $e=mysql_query("SELECT * FROM users WHERE status='Dead' AND modkill='0' ORDER BY killed_on DESC LIMIT 5"); while($f=mysql_fetch_object($e)){ $dae=mysql_fetch_object(mysql_query("SELECT * FROM dead WHERE username='$f->username'")); echo "<tr><td align=center>$f->username</td></tr>"; } ?><table bgcolor="black" class="table2" height=33%><tr align="center" class="thinline"><td colspan=2> Top 5 Players</td> </tr> <tr class=table> <td class="subhead" width="109">Username</td> </tr> <?php $tsel = mysql_query("select * from `users` where `userlevel`='0' and `status`='alive' order by `rankpoints` desc limit 5"); while ($top = mysql_fetch_array($tsel)) { print "<tr><td align=center>$top[username]</td></tr>"; } ?><table bgcolor="black" class="table2" height=33%><tr class="thinline"><td colspan=2> Site Stats</td> </tr> </tr> <tr> <td width="40%" align=right>Total Users:</td> <td width="60%" align=center><?php echo "$ud"; ?></td> </tr> <tr> <td width="40%" align=right>Game Money:</td> <td width="60%" align=center><?php echo "£$moneytot"; ?> </td> </tr> <tr> <td width="40%" align=right>Users Dead:</td> <td width="60%" align=center><?php echo "$dead"; ?></td> </tr> <tr> <td width="40%" align=right>Users Banned:</td> <td width="60%" align=center><?php echo "$banned"; ?></td> </tr> <tr> <td width="40%" align=right>Attempted Murders:</td> <td width="60%" align=center><?php echo "$attempts"; ?></td> </tr> </table> </table></td> </table> </body> </html> [\code] Thanks
×
×
  • 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.