The 3rd argument for fwrite() is the length of the string. So you should do:

$fp = fopen('./file.txt','w');
$line = "<a href=\"$url\">$text</a><br>\n";
fwrite($fp,$line,strlen($line));
fclose($fp);

--Joe

On Wed, Apr 18, 2001 at 01:38:11AM -0500, chris herring wrote:
> this is really buggin me... i've got this free-for-all that i want to make, and 
>everything seems logical, but....
> 
> echo "<form method=\"POST\" action=\"$PHP_SELF\" name=\"linkadd\">";
> echo "<input type=\"text\" name=\"url\" size=\"20\" value=\"http://\"><br>";
> echo "<input type=\"text\" name=\"text\" size=\"20\"><br>";
> echo "<input type=\"submit\" name=\"submit\" value=\"Generate New Link\">";
> echo "</form>";
> 
> 
> 
> if (isset($url) && isset($text)) {
>     $fp = fopen("./file.txt", "w");
>     fwrite("$fp", "<a href=\"$url\">$text</a><br>", "w");
>     fclose($fp);
> }
> 
> ... that isn't writing anything to the file. any help would be appreciated. thx in 
>advance


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */


-- 
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]

Reply via email to