-1

hi i am following this etutorial and the code is not working and dont get why. There are two bits of code:

>
<body>
<?
$sonnet76 = <<<HERE
Sonnet # 76, William Shakespeare

Why is my verse so barren of new bride,
And keep invention in a noted weed,
HERE;

$fp = fopen("sonnet76.txt", "w");
fputs($fp, $sonnet76);
fclose($fp);

?>

When i click this file i get permision denied and it wont write even thou i have allowed all the permisions.

<body>
<?
$fp = fopen("saveSonnet.php", "r");

//first line is title
$line = fgets($fp);
print "<center><h1>$line</h1></center>\n";

print "<center>\n";
//print rest of sonnet
while (!feof($fp)){
	$line = fgets($fp);
	print "$line <br>\n";
}

print "</center>\n";

fclose($fp);
?>

This code returns the other except it does not show the code it is all hidden. Thanks you could give me any information about what is happening and if i am doing it wrong.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by gaz
0

First code works just fine.
You'll have to chmod 777 the folder that the script is running in.

0

First code works just fine.
You'll have to chmod 777 the folder that the script is running in.

Yes the file permissions are 777 is that what you mean?

0

Yes the file permissions are 777 is that what you mean?

Its fixed i was changing indivudual files to 777 rather than the whole folder whoop shame its took two days to figure that out ha x

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.