webForumDet fria alternativet

Hjälp med koden

PHPur PHP

2 svar · 267 visningar · startad av Denniss

Medlem sedan maj 2003176 inlägg
Frågan#1

Hej !

Jag vill skydda vissa sidor och har en medlemsscript . Nu när jag vill skydda vissa sidor(endast för medlemmar) står det följande:

How-to restrict access to your pages:
1. All secure pages must be php pages. You can easily create any page in html and simply save it with a .php extention.
2. This code must be added prior to any code on the page:

<?php

//prevents caching
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: post-check=0, pre-check=0",false);
session_cache_limiter();
session_start();

//this should the the absolute path to the config.php file
//(ie /home/website/yourdomain/login/config.php or
//the location in relationship to the page being protected - ie ../login/config.php )
require('../config.php');

//this should the the absolute path to the functions.php file - see the instrcutions for config.php above
require('../functions.php');

//this is group name or username of the group or person that you wish to allow access to
// - please be advise that the Administrators Groups has access to all pages.
if (allow_access(Administrators) != "yes")
{

//this should the the absolute path to the no_access.html file - see above
include ('no_access.html');
exit;
}
?>

Jag kopierar koden rakt av men det funkar inte. Vad är det jag skall ändra i den ?

Medlem sedan aug. 20039 342 inlägg
#2

Var ligger config.php och functions.php?

Medlem sedan maj 2005562 inlägg
#3

felmeddelanden ? utskrifter ?
använd
error_reporting(E_ALL); högst upp o se om du får fler felmeddelanden

127 ms totalt · 3 externa anrop · v20260731065814-full.9823c0c5
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
124 ms — hämta tråd, inlägg och bilagor (db)