still lost, here is my session script:
session_start();
if (!isset($SESSION['initiated']))
{
session_regenerate_id();
$SESSION['initiated'] = true;
}
please , exactly what do i need to do? in newbee terms !
still lost, here is my session script:
session_start();
if (!isset($SESSION['initiated']))
{
session_regenerate_id();
$SESSION['initiated'] = true;
}
please , exactly what do i need to do? in newbee terms !
That can't be your full script. Somewhere HTML or whitespace is sent to the browser before your "session_start();" call. That's what your problem is. Not that the code is wrong, just that you're displaying info for the user prior to callin "session_start".
There has to be more code. What is it? Post your exact code of what page is using this script.
~Brett
ok, this is the whooole page i added session script to, you will see the error i get..
<html>
<head>
<?
session_start();
if (!isset($SESSION['initiated']))
{
session_regenerate_id();
$SESSION['initiated'] = true;
}
?>
<center>
<!-- Edit these colors for links -->
<style type="text/css">
A:link {text-decoration: none; color:white;}
A:visited {text-decoration: none; color:#ffffff;}
A:active {text-decoration: bold; color:#cococo;}
A:hover {text-decoration: none; color:#EE0000;}
BODY{
scrollbar-face-color:black;
scrollbar-arrow-color:red;
scrollbar-track-color:black;
scrollbar-shadow-color:'C0C0C0';
scrollbar-highlight-color:'#C0C0C0';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}
</style>
<title>Sa3bin.ZapTo.Org © My Music</title>
</head>
<body>
<BODY BGCOLOR="000000">
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<center>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="576" height="60" id="banner3.swf" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="banner3.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="false">
<embed src="banner3.swf" quality="high" bgcolor="#ffffff" width="576" height="60" name="banner3.swf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
</center>
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<table BACKGROUND="cleardot.gif">
<tr>
<td>
<p align="center"><b><font size="5"></font></b></p>
</td>
</tr>
<tr>
<td widt =" 100%">
<p align="left">
<a href="http://sa3bin.zapto.org/login.php">Home</a><br>
<a href="http://sa3bin.zapto.org/hempcamdone.php">420 Fun</a><br>
<a href="http://sa3bin.zapto.org/bb.php">Big Brother</a><br>
<a href="http://sa3bin.zapto.org/downloads.php">Downloads</a><br>
<b><font color =" red">My Music</font></b><br>
<a href="http://sa3bin.zapto.org/drawings.php">My Drawings</a><br>
<a href="http://sa3bin.zapto.org/mywebcams.php">My Webcams</a><br>
<a href="http://sa3bin.zapto.org/misccams.php">Misc Webcams</a><br>
<a href="http://sa3bin.zapto.org/peoplecams.php">People Webcams</a><br>
<a href="http://sa3bin.zapto.org/guestbook/">My GuestBook</a><br>
</td>
</tr>
</table>
<!--END OF EDIT-->
</layer>
<script type="text/javascript">
/
Floating Menu script
/
//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 3,
startY = 170;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
</body>
</html>
again, i am a noob ! lol
If you check the manual it says no output before session start so this
<html>
<head>
<?
session_start();
is wrong you have output before session_start()!
Change the start of your script to
<?
session_start();
if (!isset($_SESSION['initiated']))
{
session_regenerate_id();
$_SESSION['initiated'] = true;
}
?>
<html>
<head>
<center>
<!-- Edit these colors for links -->
<style type="text/css">
See what posting all the code does? Rincewind is right. Make those small changes and it should work.
~Brett
RTFM lol.
i dont get an error but, allows me to go straight from my bookmark welcome page into mymusic.php w/o ever asking for login...
let me make sure i have this right...
<?
session_start();
if (!isset($SESSION['initiated']))
{
session_regenerate_id();
$SESSION['initiated'] = true;
}
?>
<html>
<head>
<body>
<BODY BGCOLOR="000000">
<center>
<!-- Edit these colors for links -->
<style type="text/css">
A:link {text-decoration: none; color:white;}
A:visited {text-decoration: none; color:#ffffff;}
A:active {text-decoration: bold; color:#cococo;}
A:hover {text-decoration: none; color:#EE0000;}
BODY{
scrollbar-face-color:black;
scrollbar-arrow-color:red;
scrollbar-track-color:black;
scrollbar-shadow-color:'C0C0C0';
scrollbar-highlight-color:'#C0C0C0';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}
</style>
<title>Sa3bin.ZapTo.Org © My Music</title>
</head>
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<center>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="576" height="60" id="banner3.swf" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="banner3.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="false">
<embed src="banner3.swf" quality="high" bgcolor="#ffffff" width="576" height="60" name="banner3.swf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
</center>
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<table BACKGROUND="cleardot.gif">
<tr>
<td>
<p align="center"><b><font size="5"></font></b></p>
</td>
</tr>
<tr>
<td widt =" 100%">
<p align="left">
<a href="http://sa3bin.zapto.org/login.php">Home</a><br>
<a href="http://sa3bin.zapto.org/hempcamdone.php">420 Fun</a><br>
<a href="http://sa3bin.zapto.org/bb.php">Big Brother</a><br>
<a href="http://sa3bin.zapto.org/downloads.php">Downloads</a><br>
<b><font color =" red">My Music</font></b><br>
<a href="http://sa3bin.zapto.org/drawings.php">My Drawings</a><br>
<a href="http://sa3bin.zapto.org/mywebcams.php">My Webcams</a><br>
<a href="http://sa3bin.zapto.org/misccams.php">Misc Webcams</a><br>
<a href="http://sa3bin.zapto.org/peoplecams.php">People Webcams</a><br>
<a href="http://sa3bin.zapto.org/guestbook/">My GuestBook</a><br>
</td>
</tr>
</table>
<!--END OF EDIT-->
</layer>
<script type="text/javascript">
/
Floating Menu script
/
//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 3,
startY = 170;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
</body>
</html>
besides my welcome.php page every other page has been embeded with the session script as laid out above....can you get to these pages w/o signing up/loging on?
http://sa3bin.zapto.org/welcome.php
remember, welcome page does not have the code...should be able to browse the rest of the site uninterupted though?
thanks for the replies by the way, finaly some help !!!
I can see the other pages, but if i try to go back to "Home" it asks me to log in.
~Brett
This starts the session
session_start();
This asks if $SESSION['initiated'] is NOT set
if (!isset($_SESSION['initiated']))
Then if it's not set which it won't be for a new user then it does this
{
session_regenerate_id();
$_SESSION['initiated'] = true;
}
Which says that $_SESSION['initiated'] IS now set so that any other page you go to is now got $_SESSION['initiated'] set.
Btw waht happened to the snippet of code from my earlier post that with modification to the $_SESSION name was what you needed.
As I siad earlier not the best tutorial
rincewind456, i used the code you spelled out here, heres the exact code of my welcome.php page:
<?
session_start();
if (!isset($SESSION['initiated']))
{
session_regenerate_id();
$SESSION['initiated'] = true;
}
?>
<html>
<head>
<body>
<BODY BGCOLOR="000000">
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<center>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="576" height="60" id="banner4.swf" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="banner4.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="false">
<embed src="banner4.swf" quality="high" bgcolor="#ffffff" width="576" height="60" name="banner4.swf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
</center>
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<!-- Edit these colors for links -->
<style type="text/css">
A:link {text-decoration: none; color:white;}
A:visited {text-decoration: none; color:#ffffff;}
A:active {text-decoration: bold; color:#cococo;}
A:hover {text-decoration: none; color:#EE0000;}
BODY{
scrollbar-face-color:black;
scrollbar-arrow-color:red;
scrollbar-track-color:black;
scrollbar-shadow-color:'C0C0C0';
scrollbar-highlight-color:'#C0C0C0';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}
</style>
<title>Sa3bin.ZapTo.Org ©</title>
</head>
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<table BACKGROUND="cleardot.gif">
<tr>
<td>
<p></td>
</tr>
<tr>
<td widt =" 100%">
<p align="left">
<b><font color =" red">Home</font></b><br>
<a href="http://sa3bin.zapto.org/hempcamdone.php">420 Fun</a><br>
<a href="http://sa3bin.zapto.org/bb.php">Big Brother</a><br>
<a href="http://sa3bin.zapto.org/downloads.php">Downloads</a><br>
<a href="http://sa3bin.zapto.org/mymusic.php">My Music</a><br>
<a href="http://sa3bin.zapto.org/drawings.php">My Drawings</a><br>
<a href="http://sa3bin.zapto.org/mywebcams.php">My Webcams</a><br>
<a href="http://sa3bin.zapto.org/misccams.php">Misc Webcams</a><br>
<a href="http://sa3bin.zapto.org/peoplecams.php">People Webcams</a><br>
<a href="http://sa3bin.zapto.org/guestbook/">My GuestBook</a><br>
</tr>
</table>
<!--END OF EDIT-->
</layer>
<script type="text/javascript">
/
Floating Menu script
/
//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 3,
startY = 170;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
<BODY BGCOLOR="000000">
<center>
<font color="#EE0000">Rest Of The Site Under Construction.</font>
</center>
<BR><BR><BR>
<center>
<font color="white">1f u c4n r34d th1s u r34lly n33d t0 g37 l41d !</font>
</center>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<center>
<font size=2 color=#cococo>©Sa3bin '05</font>
</center>
</body>
</html>
bpat1434, you see the login.php page, accidently used as welcome.php page.
still able to go STRAIGHT to my welcome page or any other page beyond welcome.php...
ideas?
You're trying to restrict access right? How about you do this:
check_auth.php
<?php
function authorized()
{
if(!isset($_SESSION['initiated']))
{
// The users session has not been started, show the log-in form
return FALSE;
}
else
{
// The users session is valid, return TRUE so the page will show
return TRUE;
}
}
?>
Any page you want hidden to non-members:
<?php
session_start();
include_once('check_auth.php');
$auth = authorized();
if(authorized() == FALSE)
{
header('Location: login.php'):
}
else
{
?>
<!-- Show the protected content -->
<?php
}
?>
Hope that helps.
~Brett
You can try something like:
<?
session_start();
//set $_SESSION['initiated'] to true in the login page
//if not already logged in display the login page to login
if (!isset($_SESSION['initiated']))
{
//using header( ) redirect him to the login page
}
//if already logged in show him the page
else
{
?>
<html>
<head>
<body>
<BODY BGCOLOR="000000">
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<center>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="576" height="60" id="banner4.swf" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="banner4.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="false">
<embed src="banner4.swf" quality="high" bgcolor="#ffffff" width="576" height="60" name="banner4.swf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
</center>
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<!-- Edit these colors for links -->
<style type="text/css">
A:link {text-decoration: none; color:white;}
A:visited {text-decoration: none; color:#ffffff;}
A:active {text-decoration: bold; color:#cococo;}
A:hover {text-decoration: none; color:#EE0000;}
BODY{
scrollbar-face-color:black;
scrollbar-arrow-color:red;
scrollbar-track-color:black;
scrollbar-shadow-color:'C0C0C0';
scrollbar-highlight-color:'#C0C0C0';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}
</style>
<title>Sa3bin.ZapTo.Org ©</title>
</head>
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<table BACKGROUND="cleardot.gif">
<tr>
<td>
<p></td>
</tr>
<tr>
<td widt =" 100%">
<p align="left">
<b><font color =" red">Home</font></b><br>
<a href="http://sa3bin.zapto.org/hempcamdone.php">420 Fun</a><br>
<a href="http://sa3bin.zapto.org/bb.php">Big Brother</a><br>
<a href="http://sa3bin.zapto.org/downloads.php">Downloads</a><br>
<a href="http://sa3bin.zapto.org/mymusic.php">My Music</a><br>
<a href="http://sa3bin.zapto.org/drawings.php">My Drawings</a><br>
<a href="http://sa3bin.zapto.org/mywebcams.php">My Webcams</a><br>
<a href="http://sa3bin.zapto.org/misccams.php">Misc Webcams</a><br>
<a href="http://sa3bin.zapto.org/peoplecams.php">People Webcams</a><br>
<a href="http://sa3bin.zapto.org/guestbook/">My GuestBook</a><br>
</tr>
</table>
<!--END OF EDIT-->
</layer>
<script type="text/javascript">
/*
Floating Menu script
*/
//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 3,
startY = 170;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
<BODY BGCOLOR="000000">
<center>
<font color="#EE0000">Rest Of The Site Under Construction.</font>
</center>
<BR><BR><BR>
<center>
<font color="white">1f u c4n r34d th1s u r34lly n33d t0 g37 l41d !</font>
</center>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<center>
<font size=2 color=#cococo>©Sa3bin '05</font>
</center>
</body>
</html>
<?php
}
?>
sa3bin wrote:rincewind456, i used the code you spelled out here, heres the exact code of my welcome.php page:
<?
session_start();if (!isset($SESSION['initiated']))
{
session_regenerate_id();
$SESSION['initiated'] = true;
}
?>
snipped code
No you didn't I said to use
session_start();
if (!isset($_SESSION['userid'])){
header("location: PATH_TO/login.php");
}
Which adapted for your page would be
session_start();
if (!isset($_SESSION['initiated'])){
header("location: PATH_TO/login.php"); //Requires edit #this is the route to your login page
}
Which checks to see if $_POST['initiated'] is NOT set and if it's not then you redirect to the login page, if it is set (already logged in) then display the page.
<?php
session_start();
if (!isset($_SESSION['initiated'])){
header("location:http://sa3bin.zapto.org/login.php"); //Requires edit #this is the route to your login page
}
?>
<html>
<head>
<center>
<!-- Edit these colors for links -->
<style type="text/css">
A:link {text-decoration: none; color:white;}
A:visited {text-decoration: none; color:#ffffff;}
A:active {text-decoration: bold; color:#cococo;}
A:hover {text-decoration: none; color:#EE0000;}
BODY{
scrollbar-face-color:black;
scrollbar-arrow-color:red;
scrollbar-track-color:black;
scrollbar-shadow-color:'C0C0C0';
scrollbar-highlight-color:'#C0C0C0';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}
</style>
<title>Sa3bin.ZapTo.Org © Big Brother</title>
</head>
<body>
<BODY BGCOLOR="000000">
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<center>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="576" height="60" id="banner3.swf" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="banner3.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="false">
<embed src="banner3.swf" quality="high" bgcolor="#ffffff" width="576" height="60" name="banner3.swf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
</center>
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<table BACKGROUND="cleardot.gif">
<tr>
<td>
<p align="center"><b><font size="5"></font></b></p>
</td>
</tr>
<tr>
<td widt =" 100%">
<p align="left">
<a href="http://sa3bin.zapto.org/login.php">Home</a><br>
<a href="http://sa3bin.zapto.org/hempcamdone.php">420 Fun</a><br>
<b><font color =" red">Big Brother</font></b><br>
<a href="http://sa3bin.zapto.org/downloads.php">Downloads</a><br>
<a href="http://sa3bin.zapto.org/mymusic.php">My Music</a><br>
<a href="http://sa3bin.zapto.org/drawings.php">My Drawings</a><br>
<a href="http://sa3bin.zapto.org/mywebcams.php">My Webcams</a><br>
<a href="http://sa3bin.zapto.org/misccams.php">Misc Webcams</a><br>
<a href="http://sa3bin.zapto.org/peoplecams.php">People Webcams</a><br>
<a href="http://sa3bin.zapto.org/guestbook/">My GuestBook</a><br>
</td>
</tr>
</table>
<!--END OF EDIT-->
</layer>
<script type="text/javascript">
/
Floating Menu script
/
//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 3,
startY = 170;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
</body>
</html>
ok, i tried them all...this 1 takes me to login regardless if im loged in or not...
kept the code in this page for you to see http://sa3bin.zapto.org/bb.php
it does redirect me but, as i said...doesnt matter if loged in or not.
somebody is going to figure it out,lol....right???
added that code to every opage inside my site except mywebcams.php
can anyone else sign up and stay loged on ? http://sa3bin.zapto.org
once loged in i go to any page and asks for log in again....
what is the script for the login page, are you setting the session variable
$_SESSION['initiated']
?
hey what's up...
heres my login page...
<html>
<head>
<script language="JavaScript1.2">
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
</script>
<center>
<!-- Edit these colors for links -->
<style type="text/css">
A:link {text-decoration: none; color:white;}
A:visited {text-decoration: none; color:#ffffff;}
A:active {text-decoration: bold; color:#cococo;}
A:hover {text-decoration: none; color:#EE0000;}
BODY{
scrollbar-face-color:black;
scrollbar-arrow-color:red;
scrollbar-track-color:black;
scrollbar-shadow-color:'C0C0C0';
scrollbar-highlight-color:'#C0C0C0';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}
</style>
<title>Sa3bin.ZapTo.Org © Login</title>
</head>
</SCRIPT>
<BODY BGCOLOR="000000">
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="576" height="60" id="banner3.swf" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="banner3.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="false">
<embed src="banner3.swf" quality="high" bgcolor="#ffffff" width="576" height="60" name="banner3.swf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
<HR WIDTH="100%" COLOR="#C0C0C0" SIZE="3">
<?
?>
<!doctype html public "-//w3c//dtd html 3.2//en">
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>
<body bgcolor="#000000" text="#C0C0C0" link="#EE0000" vlink="white" alink="white">
<form action='loginck.php' method=post>
<table border='0' cellspacing='0' cellpadding='0' align=center>
<tr id='cat'>
<tr> <td bgcolor='#000000' ><font face='verdana, arial, helvetica' size='2' align='center'> Login ID
</font></td> <td bgcolor='#000000' align='center'><font face='verdana, arial, helvetica' size='2' >
<input type ='text' class='bginput' name='userid' ></font></td></tr>
<tr> <td bgcolor='#000000' ><font face='verdana, arial, helvetica' size='2' align='center'> Password
</font></td> <td bgcolor='#000000' align='center'><font face='verdana, arial, helvetica' size='2' >
<input type ='text' class='bginput' name='password' ></font></td></tr>
<tr> <td bgcolor='#000000' colspan='2' align='center'><font face='verdana, arial, helvetica' size='2' align='center'>
<input type='submit' value='Submit'> <input type='reset' value='Reset'>
</font></td> </tr>
<tr> <td bgcolor='#000000' ><font face='verdana, arial, helvetica' size='2' align='center'> <a href='signup.php'>New Member Sign UP</a></font></td> <td bgcolor='#000000' align='center'><font face='verdana, arial, helvetica' size='2' ><a href=forgot-password.php>
Forgot Password</a> ?</font></td></tr>
<tr> <td bgcolor='#000000' colspan='2' align='center'><font face='verdana, arial, helvetica' size='2' align='center'>
</font></td> </tr>
</table></center></form>
</center>
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<table BACKGROUND="cleardot.gif">
<script type="text/javascript">
/
Floating Menu script
/
//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 3,
startY = 170;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</body>
</html>
and here is my loginck.php page......
<?
include "include/session.php";
include "include/z_db.php";
//////////////////////////////
?>
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>Sa3bin © Login</title>
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>
<body bgcolor="#000000" text="#00FF00" link="#EE0000" vlink="white" alink="white">
<?
$userid=mysql_real_escape_string($userid);
$password=mysql_real_escape_string($password);
if($rec=mysql_fetch_array(mysql_query("SELECT * FROM plus_signup WHERE userid='$userid' AND password = '$password'"))){
if(($rec['userid']==$userid)&&($rec['password']==$password)){
include "include/newsession.php";
echo "<p class=data> <center>Successfully,Logged in<br><br><a href='logout.php'> Log OUT </a><br><br><a href=welcome.php>Click here if your browser is not redirecting automatically or you don't want to wait.</a><br></center>";
print "<script>";
print " self.location='welcome.php';"; // Comment this line if you don't want to redirect
print "</script>";
}
}
else {
session_unset();
echo "<font face='Verdana' size='2' color=red>Wrong Login. Use your correct Userid and Password and Try <br><center><input type='button' value='Retry' onClick='history.go(-1)'></center>";
}
?>
</body>
</html>
can you post the script for newsession.php and session.php.