5 Replies - 1515 Views - Last Post: 23 August 2009 - 07:31 PM

#1 TechWar  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 470
  • Joined: 17-February 09

question: php page un-centers after form is submitted

Posted 21 August 2009 - 03:14 PM

got a signup page and after you submit a filled out form, it is pushed back over to the right instead of being centered.
any ideas would be greatly appreciated.
register.php


<?php
session_start();
require('FuncFile.php');
if(isset($_POST['fmlyVerify'])&& $_POST['fmlyVerify']==true){
	//make sure form is filled out completely & correctly
	//if not, set $Message, if so call Register()
	//if fmlyVerify is not set, call showRegForm() again
	$userName=$_POST['uName'];
	$Fname=$_POST['fName'];
	$Lname=$_POST['lName'];
	if(!empty($_POST['uName']) && !empty($_POST['fName']) && !empty($_POST['lName']) && !empty($_POST['eMail1']) && !empty($_POST['eMail2'])&& !empty($_POST['Pass1']) && !empty($_POST['Pass2'])){
		$eMail1=$_POST['eMail1'];
		$eMail2=$_POST['eMail2'];
		if($eMail1!=$eMail2){
			$ErrMsg='Error. Email Addresses Must Match.';
		}//end if
		else{
			$Pass1=$_POST['Pass1'];
			$Pass2=$_POST['Pass2'];
			if($Pass1!=$Pass2){
				$ErrMsg='Error. Passwords must match.';
			}//end nested if
			else{
				$ErrMsg=Register($userName,$Fname,$Lname,$eMail1,$Pass1);
			}//end else
		}// end else
	}//end 2nd if
	else{
		$ErrMsg="You Must Fill Out All Fields.";
	}
}//end main if clause
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>LawzTech: Register</title>
<meta name="keywords" content="lawztech,don't leave it to chance, leave it to me,laws,laws family, michigan,MI,mi laws, laws mi,Donnie Laws, Don laws resume,laws resume, resumes,blog,contact lawztech" />
<meta name="description" content="Don't leave it to chance, leave it to me,Lawztech on the web, Resumes for Don Laws, Laws Family blog" />
<link href="styles.css" rel="stylesheet" type="text/css" media="screen" />

</head>
<body>
<div id="content">
<div id="back">
<!-- header begins -->
<div id="header">


	<div id="logo">
		<h1><a href="#">lawztech</a></h1>
		<p>Don't Leave it to Chance, Leave it to Me </p>
		<h2>&nbsp;</h2>
		
	</div>
	  <div id="menu">
		<ul>
			<li><a href="index.php"  title="">Home</a></li>
			<li><a href="blog.php" title="">Blog</a></li>
			<li><a href="gallery.php" title="">Gallery</a></li>
			<li><a href="resumes.php" title="">resumes</a></li>
			<li><a href="about.php" title="">About</a></li>
			<li><a href="contact.php" title="">Contact</a></li>
			<li><a href="forum/index.php" title="">Forum</a></li>
		</ul>
	</div>
</div>
<!-- header ends -->
<!-- content begins -->
 <div id="main">
	<div id="right">
		<h2 align="center">Registration for Lawztech Family Area</h2>
		<form id="frmRegister" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
		<table width="100%" height="311" border="0">
  <tr>
  <td width="26%" height="34"><div align="right">UserName:</div></td>
	<td colspan="2"><input type="text" name="uName" id="uName" /></td>
	<td width="33%">&nbsp;</td>
  </tr>
  <tr>
	<td width="26%" height="34"><div align="right">First Name:</div></td>
	<td colspan="2"><input type="text" name="fName" id="fName" /></td>
	<td width="33%">&nbsp;</td>
  </tr>
  <tr>
	<td height="41"><div align="right">Last Name:</div></td>
	<td colspan="2"><input type="text" name="lName" id="lName" /></td>
	<td>&nbsp;</td>
  </tr>
  <tr>
	<td height="40"><div align="right">Email Address:</div></td>
	<td colspan="2"><input type="text" name="eMail1" id="eMail1" /></td>
	<td rowspan="2"><div align="center">Family?</div>	  <p align="center">
		<label>
		  <input type="radio" name="fmlyVerify" value="true" id="fmlyVerify_0" />
		  Yes</label>
		
		<label>
		  <input type="radio" name="fmlyVerify" value="false" id="fmlyVerify_1" />
		  No</label>
		<br />
	  </p></td>
  </tr>
  <tr>
	<td height="41"><div align="right">Verify Email:</div></td>
	<td colspan="2"><input type="text" name="eMail2" id="eMail2" /></td>
	</tr>
  <tr>
	<td height="42"><div align="right">Password:</div></td>
	<td colspan="2"><input type="text" name="Pass1" id="Pass1" /></td>
	<td>&nbsp;</td>
  </tr>
  <tr>
	<td height="44"><div align="right">Verify Password:</div></td>
	<td colspan="2"><input type="text" name="Pass2" id="Pass2" /></td>
	<td>&nbsp;</td>
  </tr>
  <tr>
	<td height="40">&nbsp;</td>
	<td width="21%"><div align="center">
	  <input type="submit" name="submit" id="submit" value="Submit" />
	</div></td>
	<td width="20%"><div align="center">
	  <input type="reset" name="reset" id="reset" value="Reset" />
	</div></td>
	<td>
	<?php 
	if(isset($ErrMsg)){
		echo $ErrMsg;
	}
	?>
									
									</td>
  </tr>
</table>

		</form>
		<p align="center">&nbsp;</p>
		<p align="center">You will be notified via email when your membership has been</p>
		<p align="center">approved. You will be able to login to the members-only</p>
		<p align="center">section at that time</p>
		<p align="center">&nbsp; </p>
	</div>
	<div id="left">
	  <h3>Members</h3>
		<p>Once verified and activated, you will be able to log in to the family section of the site. This is totally seperate from your forum membership.
		<br />
		</p>
	<h3>Lawztech's favorites </h3>
			<ul>
				<li><ul>
					<li><a href="www.dreamincode.net">Dream In Code</a></li>
					<li><a href="www.rentacoder.com">Rent A Coder</a></li>
					<li><a href="www.scriptlance.com">ScriptLance</a></li>
					<li><a href="www.linkedin.com">LinkedIn</a></li>
					<li><a href="wwww.elance.com">E-Lance</a></li>
					</ul>
					<!-- AddThis Button BEGIN -->
<a href="http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4a79cc4e2b9b1800" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a79cc4e2b9b1800"></script>
<!-- AddThis Button END -->

			  </li>
			</ul>
			<br />
			<h3> rac freelance ticker  </h3>
			<ul>
				<li id="calendar">			
				<div id="calendar1">
				<IFRAME ID=IFrame1 FRAMEBORDER=0 SCROLLING=NO width=150 Height=300 SRC=						"http://www.RentACoder.com/RentACoder/misc/LinkToUs/ScrollingBidRequests.asp?txtWidth=150&txtHeight=300&blnHideChannelSubscribe=true&blnLaunchLinkInNewWindow=true&blnFullTitle=true&txtBgColor=white" height=300>
		Your browser does not support inline frames...However, you can click 
		<A href="http://www.RentACoder.com/RentACoder/misc/LinkToUs/ScrollingBidRequests.asp?blnHideChannelSubscribe=true&blnLaunchLinkInNewWindow=true&blnFullTitle=true">here</a> to see the related document.
		</IFRAME>
				
				</div>
			</li>
		  </ul>
	</div>
	

<!--content ends -->

<!--footer begins -->
	</div>

<div id="footer">
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
		src="images/vcss-blue.gif"
		alt="Valid CSS!" align="left" style="border:0;width:88px;height:31px" /></a>
  <p>Copyright &copy; 2008.</p>
<p><a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a> | <a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional"><abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" title="This page validates as CSS"><abbr title="Cascading Style Sheets">CSS</abbr></a> </p>
	</div>
</div>
</div>
<!-- footer ends-->
</body>
</html>


function file
<?php
// PHP include File
// Programmer: Don Laws
// Date: 08/11/09
// Contains Functions for all pages.

function Register($uName,$fName,$lName,$Email,$Password){
	//Connect to MySQL server
	$Conn=@mysqli_connect('localhost','124054','karllie') or die  ('<p>Unable to connect to server.</p><p>Error Code: '.	mysqli_connect_errno().': '.mysqli_connect_error().'</p>');
	echo('Successfully connected to the database.');
	
	// Set database 
	@mysqli_select_db($Conn,'124054')or die('<p>Unable to Connect Database.</p><p>Error Code: '.mysqli_errno($Conn).': '.mysqli_error($Conn).'</p>');
	echo('<p>Successfully opened database</p>');
	
	//SQL statements
	
	//check for username
	$Query="SELECT * FROM users WHERE uname='$uName'";
	$QueryResult=@mysqli_query($Conn,$Query);
	$NumRows=@mysqli_num_rows($QueryResult);
	if($NumRows!=0){
		//return error, username already in use
		$Message='Error, username is already in use. Please choose another.';
		return $Message;
	}
	else{
	//if username isn't found, add user
	$Query="INSERT INTO users(password,uname,fname,lname,email) VALUES('$Password','$uName','$fName','$lName','$Email')";
	$QueryResult=@mysqli_query($Conn,$Query);
	$Message='Successfully Added User. Your Account Will Be Activated Soon.';
	return $Message;
}//end else

}//end of Register() function


?>



Thanks again y'all

Is This A Good Question/Topic? 0
  • +

Replies To: question: php page un-centers after form is submitted

#2 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3037
  • View blog
  • Posts: 10,614
  • Joined: 08-August 08

Re: question: php page un-centers after form is submitted

Posted 21 August 2009 - 05:06 PM

It doesn't happen on my system, but I don't have your css file, and that's probably where the problem is. PHP doesn't center anything. That's up to html and css, so I'll move this to the appropriate forum.

You should post your css so that others can help with it. My guess is that your positioning is relative.
Was This Post Helpful? 0
  • +
  • -

#3 TechWar  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 470
  • Joined: 17-February 09

Re: question: php page un-centers after form is submitted

Posted 21 August 2009 - 08:47 PM

I'll be happy to post it, but I still think the PHP code is the culprit, mainly because it only happens if the form is Filled Out and submitted.
If the form is blank, it won't do it.

Anyway, here's my css
Thanks again :^:

*
{
margin: 0px;
padding: 0px;
}

a:link {
	color: #107280;
}

a:hover {
	text-decoration: none;
	color: #FF0000;
}

a:visited {
	color: #107280;
}

body {
	
	background: #FFD723 url(images/back_all.gif);
	font: 13px Tahoma, Verdana, Arial, Helvetica, sans-serif;
	color: #666666;
}

#content
{
	margin: 0 auto;
	background: #ffffff;
	width: 762px;
	text-align: left;
	padding-left: 10px;
	padding-right: 10px;
	
}

#back
{
background: #CEF9FF;
width: 762px;
}

#header {
	height: 246px;
	text-align: left;
	padding-top: 10px;		
}

#menu
{
	width: auto;
	height: 49px;
	padding-left: 92px;
	background: url(images/menu.gif) repeat-x;
	margin-top: 10px;
	margin-right: 9px;
	margin-bottom: 10px;
	margin-left: 10px;
}

#menu ul {
	list-style: none;	
}

#menu li {
	
	display: inline; 
	
}

#menu a {
	float: left;
	width: 79px;
	height: 32px;
	display: block;
	text-align: center;
	text-decoration: none;
	color: #000000;
	font-weight: bold;
	font-size: 12px;
	text-transform: uppercase;
	padding-top: 15px;

}

#menu a:hover {
	width: 79px;
	height: 32px;
	color: #ffffff;
	text-decoration: underline;
	background: url(images/menu_r.gif) repeat-x;
}


#logo {
	width: 728px;
	height: 147px;
	text-align: right;
	padding-top: 30px;
	padding-right: 30px;
	margin-left: 10px;
	background-image: url(images/profBanner.jpg);
	background-repeat: no-repeat;
	color: #FF9;
}


#logo a {
	text-decoration: none;
	text-transform: lowercase;
	font-style: italic;
	font-size: 24px;
	color: #000;
}
#logo H2 a
{
font-size: 12px;
}

#famLogo {
	width: 728px;
	height: 147px;
	text-align: right;
	padding-top: 30px;
	padding-right: 30px;
	margin-left: 10px;
	background-image: url(images/FamBanner.jpg);
	background-repeat: no-repeat;
	color: #FF0;
}


#famLogo a {
	text-decoration: none;
	text-transform: lowercase;
	font-style: italic;
	font-size: 18px;
	color: #000;
}
#famLogo H2 a
{
	font-size: 12px;
	color: #00F;
}

#left
{
	width: 223px;
	margin-left: 10px;
	text-align: center;
}

#left H3
{
width: 208px;
height: 37px;
font-size: 14px;
font-weight: bold;
padding-left: 15px;
padding-top: 15px;
text-transform: uppercase;
color: #ffffff;
background: url(images/title.gif) no-repeat;
}

#left ul {
	list-style: none;
	border-bottom: 1px solid #0C728C;
	border-left: 1px solid #0C728C;
	border-right: 1px solid #0C728C;
}

#left li ul {
	border: 0px;
	margin-left: 20px;
	margin-bottom: 10px;
}

#left li li {
	padding: 4px 20px;
	background: url(images/small.gif) no-repeat left;
}

#left a {
	color: #107280;
}
#left a:visited {
	color: #107280;
}

#left p
{
padding: 10px;
border-bottom: 1px solid #107280;
border-left: 1px solid #107280;
border-right: 1px solid #107280;
}

#calendar1 {
	margin-right: auto;
	margin-left: auto;
	padding-top: 0;
	padding-right: 10px;
	padding-bottom: 20px;
	padding-left: 10px;
	text-align: center;
}

#calendar table {
	width: 100%;
	text-align: center;
}

#calendar thead {

}

#calendar tbody td {
	border: 1px solid #F1F1F1;
}

#calendar #prev {
	text-align: left;
}

#calendar #next {
	text-align: right;
}

#calendar tfoot a {
	text-decoration: none;
	font-weight: bold;
}

#calendar #now {
	background: #696969;
	border: 1px solid #ff0000;
	font-weight: bold;
	color: #ffffff
}

#right
{
float: right;
width: 480px;
padding-right: 10px;
}

#right H4
{
	margin: 0;
	padding: 0px;
	font-size: 12px;
	color: #107280;
}

#right a
{
color: #107280;
text-decoration: none;
}

#right p {
	margin: 0;
	padding: 0;
	padding-bottom: 10px;
}

#right h2 {
	margin: 0;
	padding: 0;
	padding-top: 10px;
	color: #107280;
}
.date {
	text-align: right;
	color: #808080;
	font-size: 11px;
}

.date a {
	color: #D72020;
}

#right ul, #right ol
{
margin-left: 30px;
}

#footer {
	height: 37px;
	clear: both;
	padding-top: 10px;
	background: url(images/menu.gif) repeat-x;
	margin-left: 10px;
	margin-right: 10px;
	width: 743px;
}

#footer p {
	margin: 0;
	font-size: 10px;
	text-align: center;
	color: #ffffff;
}

#footer a {
	color: #ffffff;
}



Was This Post Helpful? 0
  • +
  • -

#4 TechWar  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 470
  • Joined: 17-February 09

Re: question: php page un-centers after form is submitted

Posted 23 August 2009 - 04:34 PM

Surely someone's run across this before. Any help guys?
Thanks
Was This Post Helpful? 0
  • +
  • -

#5 tommyflint  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 34
  • View blog
  • Posts: 679
  • Joined: 24-July 08

Re: question: php page un-centers after form is submitted

Posted 23 August 2009 - 04:41 PM

A link to the page in question may help?
Was This Post Helpful? 0
  • +
  • -

#6 TechWar  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 470
  • Joined: 17-February 09

Re: question: php page un-centers after form is submitted

Posted 23 August 2009 - 07:31 PM

It might, but the page is not live yet, it still resides on my machine/testing server(apache2.2/MySQL5.1/PHP5)

This post has been edited by TechWar: 23 August 2009 - 07:35 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1