This isnt' writing to the file, is the array_unshift replacing the fputs() ? Also I had to remove the fclose in order to get it to run without an error...
Sorry for your troubles, but thanks for helping..
Here is what I have now, runs with no errors, but doesn't write to the file.
PHP Code:
<?php
$site1= "links.php";
$var11 = stripslashes( $links );
$var12 = stripslashes ( $user );
$var13 = stripslashes ( $www );
$file = "links.txt";
$filecontents = file($file);
array_unshift($filecontents,"
<br /><a href=\"$var13\" >".$var12."<a />
:
".$var11." <br />
\n" );
# add comment to front of file, not end
if (count($file)>10)
array_pop($filecontents);
header("Location: {$site1}" );
# rewrite file entirely.
?>
With this code I'm getting another parse error, tried editing it, but just get a new error..
Parse error: parse error, unexpected '\"' in /home/isolated/public_html/test/updatelinks.php on line 9
PHP Code:
<?php
$site1= "links.php";
$var11 = stripslashes( $links );
$var12 = stripslashes ( $user );
$var13 = stripslashes ( $www );
$file = "links.txt";
$filecontents = file($file);
array_unshift($filecontents,"
<br /><a href=""\"$var13\" >".$var12."<a />
:
".$var11." <br />
\n" );
# add comment to front of file, not end
if (count($file)>100)
array_pop($filecontents);
header("Location: {$site1}" );
# rewrite file entirely.
?>
Bookmarks