Forum Moderators: coopster
I am trying to create a small site that allows users to login, message each other etc...
I am using sessions for identified logins and logouts. I was storing the session data in global runtime variables, however my buddy told me that there is a compatibility hack for this and it's not secured.
This is my first time creating something fully in php and have no idea what else I could use or if there is anything I can do to fix this.
pointers, links would be much appreciated
I am working with Windows BTW
thx
J
So instead of using $username and registering variable with the session and all that, just use
$_SESSION['username']
The main problem with register_globals being on is not security, but simply unstable code and unexpected results. If you turn it off, there's less chance of one variable overwriting another (i.e. $_SESSION['username'] overwriting $_POST['username']).
Tom
How do I display the info wrapped in css?
I got this page but I cant get it to work.
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN>
<html>
<head>
<title>title/title>
<link rel=shortcut icon href=/images/favicon.ico type=image/x-icon/>
<link rel=stylesheet type=text/css href=/css/styles.css>
<script type=text/javascript>
<!-- hide
function alter(what,col)
{
try
{
(what!= null)? what.style.background = col : null;
}
catch(errorObject)
{
alert('what is not an obj\t error = ' + errorObject.description);
}
}
//end hiding-->
</script>
</head>
<body background=#E7C981>
<? php
/* Check User Script */
session_start(); // Start Session
if ( empty( $id ) ) {
print "$message";
include 'file';
}
else {
print "
<table cellpadding=0 cellspacing=2 align=left border=0 class=mainTable>
<thead>
<tr>
<th valign=top>
the rest of the html
<th valign=top>
</tr>
</thead>
</table>";)
?>
else {, and to 'wrap' it in css, you just have to make sure that css file you're pulling in there actually exists, add a class or two, and add these classes to your HTML - you've already got maintable here - so your css should have something like:
table.maintable {
color: #fcc;
border: #3f3 dotted 4px;
font-family: "Comic Sans MS";
text-decoration: blink;
}
else {
print "
<table cellpadding='0' cellspacing='2' align='left' border='0' class='mainTable'>
<tr class='thread'>
<th valign='top'>
the rest of the html
<th valign='top'>
</tr>
</table>";)
}
?>
You'll also see I removed '<thread>' - looks to me like you might be trying xml-xsl here? In ordinary css, just make another rule in your css file:
tr.thread {
color: #fd0;
}