Page 7 of 9

Re: Questions on the videos

Posted: Fri Jan 15, 2010 11:09 pm
by zolacat999
OK here is my logo.php and style.css and yes my logo does uses divs

Code: Select all

<div id="login"><div align="center"><img src="xampp/img/logo.gif" width="354" height="150" border="0" />

Code: Select all

body {
   background-color: #ffffff;
}
#login {
   position:absolute;
   left:0px;
   top:0px;
   width:800px;
   height:150px;
   z-index:1;
}
#login2 {
   position:absolute;
   left:0px;
   top:200px;
   width:800px;
   height:150px;
   z-index:1;
}
#player {
   position:absolute;
   left:400px;
   top:200px;
   width:450px;
   height:450px;
   z-index:3;
}
#creature {
   position:absolute;
   left:400px;
   top:400px;
   width:450px;
   height:450px;
   z-index:3;
}
#logout {
   position:absolute;
   left:10px;
   top:10px;
   width:150px;
   height:150px;
   z-index:3;
}
#locations {
   position:absolute;
   left:400px;
   top:300px;
   width:450px;
   height:450px;
   z-index:3;
}

Re: Questions on the videos

Posted: Sat Jan 16, 2010 4:41 am
by Jackolantern
Do you close that opening <div> tag? If not, that could maybe be a problem.

Re: Questions on the videos

Posted: Sat Jan 16, 2010 2:58 pm
by Torniquet
stop using absolute positioning unless you know how to controle it tbh.

if you insist on using absolute positioning, create a holder div with a positioning of relative and a fixed width.

or instead of using divs use a series of tables. but i highly advise staying away from absolute positioning unless you know what your doing and for styling an entire site.

Re: Questions on the videos

Posted: Sat Jan 16, 2010 4:53 pm
by Jackolantern
Yeah, absolute positioning is kind of a non-standard part of the standard. It can completely break or obscure other parts of the page on different resolutions and browsers, so it requires a lot of know-how and testing to do it correctly.

Re: Questions on the videos

Posted: Sat Jan 16, 2010 5:59 pm
by zolacat999
What would you advise I use instead of absolute positioning

Re: Questions on the videos

Posted: Sat Jan 16, 2010 7:08 pm
by OldRod
What I've done so far on mine is to make the DIVs on the left and right side of the screen absolute and let the middle one grow to fill between them.

That way the side panels stay a constant size (as there's formatted stuff shown in there that gets messed up if it wraps) even if the browser size changes.

Here's one of the panels on the right side of the screen:

Code: Select all

#playerlistbar {
	position: absolute;
	top: 150px;
	right: 20px;
	width: 320px;
	margin: 0;
	min-height:250px;
	height:250px;
	overflow:auto;
	text-align: left;
	padding: 0;
	background-color: #C0C0C0;
	font-size: 10px;
	color:#000000;
	border: 1px solid #336699;
}
Here's one from the left side:

Code: Select all

#statuspanel {
	position: absolute;
	top: 100px;
	left: 20px;
	width: 250px;
	margin: 0;
	text-align: left;
	padding: 0;
	background-color: #C0C0C0;
	font-size: 12px;
	color:#000000;
	border: 1px solid #336699;
}
And here's the middle one:

Code: Select all

#main {
	min-height:500px;
	height:500px;
	overflow:auto;
	margin: 20px 360px 0 290px;
	text-align: left;
	padding: 0;
	background-color: #C0C0C0;
	font-size: 12px;
	color:#000000;
	border: 1px solid #336699;
}
No idea if this is how it's supposed to be done or not, but it's working for me so far in various sizes of Firefox and IE browsers.

Re: Questions on the videos

Posted: Tue Jan 19, 2010 12:01 pm
by zolacat999
Thanks for the help on my last problem new one now not sure if it's me or everyone and no one has noticed yet but the login password doesn't work for me, the username has to be correct but as long as the password is the correct length it allows you to log in, for example i've been using bob2 for username and bob2 for password. if i type that in i log in ok but say if i put username bob2 and password doge it still lets me log in, does anyone else have this/ tried this

Re: Questions on the videos

Posted: Tue Jan 19, 2010 12:41 pm
by Jackolantern
zolacat999 wrote:Thanks for the help on my last problem new one now not sure if it's me or everyone and no one has noticed yet but the login password doesn't work for me, the username has to be correct but as long as the password is the correct length it allows you to log in, for example i've been using bob2 for username and bob2 for password. if i type that in i log in ok but say if i put username bob2 and password doge it still lets me log in, does anyone else have this/ tried this
I haven't seen the login video yet. Is your code storing the password with either hash($password) or password($password), and then storing it in the database on sign-up? After that, when the user wants to login, you would have to compare what they have typed in (again run through either hash($password) or password($password)) to what you have in the database. As far as I know, hashing and password() are one-way conversions, so it must be compared to itself in its hashed format.

Re: Questions on the videos

Posted: Tue Jan 19, 2010 1:16 pm
by OldRod
If I remember right, the code posted on the login tutorial thread has an error.

Something like

Code: Select all

select name,password from players where name='$player' and '$password'
should be

Code: Select all

select name,password from players where name='$player' and password='$password'
I can't remember exactly, and I can't find it at the moment, but there's a bad code fragment floating around one of the threads :)

The first one will work as long as $password isn't NULL I think, so that may be your problem.

Re: Questions on the videos

Posted: Tue Jan 19, 2010 2:34 pm
by hallsofvallhalla
yes its a mistake that has been haunting me terribly. Everyone misses it

Code: Select all

name='$player' and '$password'
should be

Code: Select all

name='$player' and password ='$password'