shergold Posted July 8, 2009 Share Posted July 8, 2009 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. Link to comment https://forums.phpfreaks.com/topic/165123-fatal-error-allowed-memory-size-of-33554432-bytes-exhausted/ Share on other sites More sharing options...
RussellReal Posted July 8, 2009 Share Posted July 8, 2009 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 Link to comment https://forums.phpfreaks.com/topic/165123-fatal-error-allowed-memory-size-of-33554432-bytes-exhausted/#findComment-870690 Share on other sites More sharing options...
shergold Posted July 8, 2009 Author Share Posted July 8, 2009 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. Link to comment https://forums.phpfreaks.com/topic/165123-fatal-error-allowed-memory-size-of-33554432-bytes-exhausted/#findComment-870696 Share on other sites More sharing options...
RussellReal Posted July 8, 2009 Share Posted July 8, 2009 idk your code isn't showing me much I can help you with ... Sorry, post more code post the code from each of the pages you include and then I can help you more Link to comment https://forums.phpfreaks.com/topic/165123-fatal-error-allowed-memory-size-of-33554432-bytes-exhausted/#findComment-870711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.