Great thanks malcolmboston.
I suppose you couldnt know about the initial questions would you?
A really big problem! :(
Moderator: General Moderators
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
-
Think-Digitally
- Forum Commoner
- Posts: 25
- Joined: Wed Feb 04, 2004 2:25 pm
I have a script already done, it all works... but I cant get the login to make sure that the viewer is logged in, otherwise they can just type in the URL and no need to join.
Maybe I was writting it wrong. this is how I did it, and you can tell me what the hell I am doing wrong!!
I have made a new file called context.php and put this in it;
<?
function session_checker(){
if(!session_is_registered('first_name')){
include 'loginform.htm';
exit();
}
}
?>
exactly like that on its own in that file.
In the html document that I want to protect from viewers that are not logged in I have put this at the top before the <html> tag.
<?php
include 'context.php';
session_start();
session_checker();
?>
Is that completely wrong??
Maybe I was writting it wrong. this is how I did it, and you can tell me what the hell I am doing wrong!!
I have made a new file called context.php and put this in it;
<?
function session_checker(){
if(!session_is_registered('first_name')){
include 'loginform.htm';
exit();
}
}
?>
exactly like that on its own in that file.
In the html document that I want to protect from viewers that are not logged in I have put this at the top before the <html> tag.
<?php
include 'context.php';
session_start();
session_checker();
?>
Is that completely wrong??
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
just cleaning it up; 2 mins
Code: Select all
<?
function session_checker(){
if(!session_is_registered('first_name')){
include 'loginform.htm';
exit();
}
}
?>
exactly like that on its own in that file.
In the html document that I want to protect from viewers that are not logged in I have put this at the top before the <html> tag.
<?php
include 'context.php';
session_start();
session_checker();
?>