Hello
Guest
, please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length.
ZFGC
>
Resources
>
Coding
>
PHP Help - Fatal Error
« previous
next »
Pages: [
1
]
Go Down
Print
Author
Topic: PHP Help - Fatal Error (Read 1186 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
<?php
include
"check.php"
;
$posts
=
"posts.txt"
;
echo
&
#39;
<!
DOCTYPE html
PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
>
Shoutbox
</
title
>
<
link
href
=
"style.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
</
head
>
<
body
>&
#39;;
echo
&
#39;
<
form action
=
"check.php"
>
<
input type
=
"text"
value
=
"Name"
name
=
"name"
/><
br
/>
<
input type
=
"text"
value
=
"Text.."
name
=
"post"
/><
br
/>
<
input type
=
"submit"
value
=
"Post"
name
=
"submit"
/>
</
form
>
<
hr
/>&
#39;;
echo
$displaypost
;
echo
&
#39;
</
body
>
</
html
>&
#39;;
?>
Can anybody tell me what the problem is?
Logged
Windy
Re: PHP Help - Fatal Error
«
Reply #1 on:
March 31, 2008, 12:42:27 am »
Reputation: +0/-0
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
Windy
Re: PHP Help - Fatal Error
«
Reply #3 on:
March 31, 2008, 01:44:15 am »
Reputation: +0/-0
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
Infinitus
Re: PHP Help - Fatal Error
«
Reply #5 on:
March 31, 2008, 06:35:33 am »
Reputation: +3/-0
Offline
Gender:
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
<?php
ini_set
(
"memory_limit"
,
"32M"
)
;
include
"check.php"
;
$posts
=
"posts.txt"
;
echo
&
#39;
<!
DOCTYPE html
PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
>
Shoutbox
</
title
>
<
link
href
=
"style.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
</
head
>
<
body
>&
#39;;
echo
&
#39;
<
form action
=
"check.php"
>
<
input type
=
"text"
value
=
"Name"
name
=
"name"
/><
br
/>
<
input type
=
"text"
value
=
"Text.."
name
=
"post"
/><
br
/>
<
input type
=
"submit"
value
=
"Post"
name
=
"submit"
/>
</
form
>
<
hr
/>&
#39;;
echo
$displaypost
;
echo
&
#39;
</
body
>
</
html
>&
#39;;
?>
check.php
Code: PHP
<?php
ini_set
(
"memory_limit"
,
"32M"
)
;
include
"index.php"
;
$posts
=
"posts.txt"
;
$username
=
$_get
[
&
#39;name'];
$userpost
=
$_get
[
&
#39;post'];
$fullpost
=
$_get
[
&
#39;name']; $_get['post'];
if
(
file_exists
(
$posts
)
)
{
$displaypost
=
file_get_contents
(
$posts
)
;
}
$handle
=
fopen
(
$posts
,
&
#39;w');
fwrite
(
$handle
,
$fullpost
)
;
fclose
(
$handle
)
;
?>
Logged
Infinitus
Re: PHP Help - Fatal Error
«
Reply #7 on:
March 31, 2008, 11:25:02 pm »
Reputation: +3/-0
Offline
Gender:
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
Print
Pages: [
1
]
Go Up
« previous
next »
ZFGC
>
Resources
>
Coding
>
PHP Help - Fatal Error
Contact Us
|
Legal
|
Advertise Here
2013 © ZFGC, All Rights Reserved
anything