figured it out
just had to use fread first.
$fpoint3 = fopen ($testshadow, "r+") or die("couldnt open shadow file again");
$contents = fread ($fpoint3, $shadowfilesize);
fputs ($fpoint3, ereg_replace("$data[0]:$shadow[1]", "$data[0]:$data[1]", $contents));
tho i will say it was a pain in the ass to get it to work..
now i can delete all my echo lines so i could follow the script with stdout :}
<-----CoreComm-Internet-Services---http://core.com----->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED] Network Operations)
<-----Enthalpy.org-------------http://enthalpy.org----->
([EMAIL PROTECTED] The World of Nothing)
<------------------------------------------------------>
On Tue, 13 Mar 2001, enthalpy wrote:
>
> can you use str_replace or ereg_replace in an fputs statement?
>
> something like this
>
> fputs("$fpoint2", "str_replace($oldcrypt, $newcrypt, $shadow[2])");
>
> i need to replace a string in a file. the string is in an array tho.. is that why
>this isnt working?
>
> <-----CoreComm-Internet-Services---http://core.com----->
> (Jon Marshall CoreComm Services Chicago)
> ([EMAIL PROTECTED] Systems Engineer II)
> ([EMAIL PROTECTED] Network Operations)
> <-----Enthalpy.org-------------http://enthalpy.org----->
> ([EMAIL PROTECTED] The World of Nothing)
> <------------------------------------------------------>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]