Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.