|
Posted by Kimmo Laine on 06/18/05 16:01
"Ron Eggler" <NOspam@hotmail.com> kirjoitti
viestissδ:3higceFh4iriU1@individual.net...
> Kimmo Laine wrote:
> [snip]
>> Hmm file_put_contents is fairly new function, available since PHP5.
>> It is seems that you're running the script with older php.
> yup, php 4.3.3
>> Doesn't
>> matter, that's just a shortcut for:
>>
>> if(@$handler = fopen("emails.txt","w")){
>> foreach($emails as $line) fputs($handler, "$line\r\n", 512);
>> fclose($handler);
>> }
>
> But following function doesn't remove the passed string ($email_address)
> out of the textfile ($blacklist)
I'll just copy below, what I answered to you a couple of days ago, when you
were opening another file inside a function...
-------
$blacklist has not been defined, or it is outside the variablescope. I'm
guessing you've defined $blacklist elsewhere in the code. The easiest thing
to do is define $blacklist global. Just insert the line
global $blacklist;
at the first line of the funtion, before $file=fopen(.... That way the
function "sees" the variable as well, and therefore knows what to open.
-------
Honestly, Ron... I thought you got it the first time?
--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears
eternal.erectionN0@5P4Mgmail.com
[Back to original message]
|