Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: PHP Help - Fatal Error  (Read 1184 times)

0 Members and 1 Guest are viewing this topic.

alirazaq

PHP Help - Fatal Error
« on: March 30, 2008, 11:48:08 pm »
http://ar31.com/spaces/shoutbox/

Source of script:
Code: PHP
  1. <?php
  2.  
  3. include "check.php";
  4.  
  5. $posts = "posts.txt";
  6.  
  7. echo &#39;
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <title>Shoutbox</title>
  12. <link href="style.css" rel="stylesheet" type="text/css" />
  13. </head>
  14. <body>&#39;;
  15.  
  16. echo &#39;
  17. <form action="check.php">
  18. <input type="text" value="Name" name="name"/><br/>
  19. <input type="text" value="Text.." name="post"/><br/>
  20. <input type="submit" value="Post" name="submit"/>
  21. </form>
  22. <hr/>&#39;;
  23.  
  24. echo $displaypost;
  25.  
  26. echo &#39;
  27. </body>
  28. </html>&#39;;
  29.  
  30. ?>
  31.  

Can anybody tell me what the problem is?
Logged
Re: PHP Help - Fatal Error
« Reply #1 on: March 31, 2008, 12:42:27 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
ini_set("memory_limit","8M");
where 8M is the number of megabytes you wish to allow

although I'd say the source of the problem isn't in that script, but elsewhere.
Logged

alirazaq

Re: PHP Help - Fatal Error
« Reply #2 on: March 31, 2008, 12:51:35 am »
Thats not it

Where am I supposed to put the ini_set thing?
Logged
Re: PHP Help - Fatal Error
« Reply #3 on: March 31, 2008, 01:44:15 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
at the top would be the best place
also, what's not it?
Logged

alirazaq

Re: PHP Help - Fatal Error
« Reply #4 on: March 31, 2008, 01:45:05 am »
Well thats what it is at right now
The error is still there
Logged
Re: PHP Help - Fatal Error
« Reply #5 on: March 31, 2008, 06:35:33 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
SOurce code of check.php and index.php please? Seems your going on a bit of a ramage with memory allocation.
Logged

alirazaq

Re: PHP Help - Fatal Error
« Reply #6 on: March 31, 2008, 11:21:30 pm »
index.php
Code: PHP
  1. <?php
  2. ini_set("memory_limit","32M");
  3.  
  4. include "check.php";
  5.  
  6. $posts = "posts.txt";
  7.  
  8. echo &#39;
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <html xmlns="http://www.w3.org/1999/xhtml">
  11. <head>
  12. <title>Shoutbox</title>
  13. <link href="style.css" rel="stylesheet" type="text/css" />
  14. </head>
  15. <body>&#39;;
  16.  
  17. echo &#39;
  18. <form action="check.php">
  19. <input type="text" value="Name" name="name"/><br/>
  20. <input type="text" value="Text.." name="post"/><br/>
  21. <input type="submit" value="Post" name="submit"/>
  22. </form>
  23. <hr/>&#39;;
  24.  
  25. echo $displaypost;
  26.  
  27. echo &#39;
  28. </body>
  29. </html>&#39;;
  30.  
  31. ?>

check.php
Code: PHP
  1. <?php
  2. ini_set("memory_limit","32M");
  3.  
  4. include "index.php";
  5.  
  6. $posts = "posts.txt";
  7.  
  8. $username = $_get[&#39;name&#39;];
  9. $userpost = $_get[&#39;post&#39;];
  10. $fullpost = $_get[&#39;name&#39;]; $_get[&#39;post&#39;];
  11.  
  12. if(file_exists($posts))
  13. {
  14.   $displaypost = file_get_contents($posts);
  15. }
  16. $handle = fopen($posts, &#39;w&#39;);
  17. fwrite($handle, $fullpost);
  18. fclose($handle);
  19.  
  20. ?>
Logged
Re: PHP Help - Fatal Error
« Reply #7 on: March 31, 2008, 11:25:02 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
You have a circular include, index.php is including check.php which is including index.php which is including check.php ... etc ... etc. Its stuck in an infinite include repeat.
Logged

alirazaq

Re: PHP Help - Fatal Error
« Reply #8 on: March 31, 2008, 11:35:10 pm »
Oh thanks, also am I doing it right?
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.055 seconds with 56 queries.

anything