Jump to content

Fatal error: Allowed memory size of 33554432 bytes exhausted


shergold

Recommended Posts


hey could anyone help me with this please,

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1024 bytes) in /website/

 

i dont understant what is happening when this is the code:

 

<?php
  $page = $_GET

;

if ($page == "index")
include("index.php");
elseif ($page == "contact")
include ("contact.php");
elseif ($page == "login")
include ("login.php");
elseif ($page == "upload")
include ("upload.php");
else 
include ("index.php"); 
?>

 

Thanks allot,

shergold.

maybe inside 1 of the included pages, it includes the same page.. and so it keeps including including till its allowed memory is all used up..

 

OR! You could be throwing yourself into a loop and filling an array with never ending data.. it takes alot to get to that limit :P


ok thankyou, that helped allot, i just read through and realised that it is a never ending loop although now i was hoping you could tell me an alternative from the following so i dont have to update every page on my website instead of using include, this is what i have at the moment that was looping:

 

The include page:

<?php
  $page = $_GET

;

if ($page == "index")
include("index.php");
elseif ($page == "contact")
include ("contact.php");
elseif ($page == "login")
include ("login.php");
elseif ($page == "upload")
include ("upload.php");
else 
include ("index.php"); 
?>

 

The index page and all other pages on site:

 

<?php include("getp.php"); ?>

 

Thanks,

Shergold.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.