---
title: "Hjälp med koden"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/142814-hjälp-med-koden"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "Denniss"
published: "2006-02-21T18:35:01.000Z"
updated: "2006-02-21T19:12:36.000Z"
replies: 2
views: 269
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/142814-hjälp-med-koden"
---

# Hjälp med koden

## #1 — Denniss, 2006-02-21T18:35Z

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 ?

Permalänk: https://www.webforum.nu/p/142814

## #2 — nitro2k01, 2006-02-21T18:37Z

Var ligger config.php och functions.php?

Permalänk: https://www.webforum.nu/p/1770397

## #3 — sl0k, 2006-02-21T19:12Z

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

Permalänk: https://www.webforum.nu/p/1770418

---

Tråden på webben: https://www.webforum.nu/amne/php/142814-hjälp-med-koden
