Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help changing code HELP!!!!!!!!!!!!!!!!!

0 views
Skip to first unread message

Mark Clarkstone

unread,
Jun 19, 2003, 4:57:49 AM6/19/03
to php-w...@lists.php.net
Hey I need your help I want to change a part of the config.php file in my
script which is

$allow = "1"; // to allow comments 1 = yes 0 = no

I'm trying to change it to $allow = "0"; using a other file I have this code
but i get errors

<?
require("config.php");
$changeallow = substr_replace($allow, '0', 0);

if ($configallow=="yes") {

$data = "$allow = /"0/";";
$fp = fopen("config.php",'a');
$fw = fwrite($fp,$data);
fclose($fp);
}
?>

If you have another code i could use please help me out!!!!!!!!!!!!!!!!!!!

Thanks


Erythros

unread,
Jun 19, 2003, 10:51:10 AM6/19/03
to php-w...@lists.php.net
what are the errors that you get?

"Mark Clarkstone" <mark.cl...@ntlworld.com> wrote in message
news:2003061909033...@pb1.pair.com...

Mark Clarkstone

unread,
Jun 20, 2003, 4:28:41 AM6/20/03
to php-w...@lists.php.net
Something about lumer?

"Erythros" <eryt...@erythros.d2g.com> wrote in message
news:200306191451...@pb1.pair.com...

Luis Moreira

unread,
Jun 20, 2003, 5:10:42 AM6/20/03
to erythros, php-w...@lists.php.net
This is not very clear to me.
First, what errors do you get ?
Second, in one place you have

$changeallow (that you don't use)

and further ahead

$configallow (that is not initializazed)

Which one is the good one ?


Luis

> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Mark Clarkstone

unread,
Jun 20, 2003, 8:14:37 AM6/20/03
to php-w...@lists.php.net
this

Parse error: parse error, unexpected T_LNUMBER in
c:\www\apache\htdocs\scripts\string\test.php on line 9

"Mark Clarkstone" <mark.cl...@ntlworld.com> wrote in message

news:2003062008284...@pb1.pair.com...

Sven

unread,
Jun 20, 2003, 10:22:14 AM6/20/03
to php-w...@lists.php.net
what about the escaped doublequotes?
should be \" not /" (backslash, not slash).
ciao SVEN

"Mark Clarkstone" <mark.cl...@ntlworld.com> schrieb im Newsbeitrag
news:2003062012143...@pb1.pair.com...

Erythros

unread,
Jun 20, 2003, 11:31:40 AM6/20/03
to php-w...@lists.php.net
i think this has to do with the value you set in $allow. in config.php you
set it to "1" then in test.php you checked for the value "yes".... hence
unexpected number value when it was looking for a char....

"Mark Clarkstone" <mark.cl...@ntlworld.com> wrote in message

news:2003062012143...@pb1.pair.com...

Erythros

unread,
Jun 20, 2003, 11:27:40 AM6/20/03
to php-w...@lists.php.net
please also include config.php....

"Mark Clarkstone" <mark.cl...@ntlworld.com> wrote in message
news:2003061909033...@pb1.pair.com...

0 new messages