PDA

View Full Version : another help


magic
04-14-2006, 04:00 AM
i have include this code in my webpage<?php
if (file_exists("test.txt")) {
$fp = fopen("test.txt", "w");
$i = "hallo";
fwrite($fp, $i, 6);
fclose($fp);



}

?>

and this turns op

Warning: fopen(test.txt): failed to open stream: Permission denied in /www/htdocs/matriki/http/test.php on line 3

Warning: fwrite(): supplied argument is not a valid stream resource in /www/htdocs/matriki/http/test.php on line 5

Warning: fclose(): supplied argument is not a valid stream resource in /www/htdocs/matriki/http/test.php on line 6

Terry
04-16-2006, 01:09 AM
The first error is because you haven't set the correct permissions for that file. The second and third errors occur due to the first error. Fix the first error and the other two errors will go away.

magic
04-16-2006, 11:22 AM
The first error is because you haven't set the correct permissions for that file. The second and third errors occur due to the first error. Fix the first error and the other two errors will go away.
thanks terry you were right but i had figured it alraedy out on the same day as is maked this thread but i now have another question how can you define keys in php????

Frank
05-22-2006, 11:22 PM
What exactly do you mean by "define keys"? Not really sure what you are trying to do here.

magic
07-16-2006, 11:35 AM
What exactly do you mean by "define keys"? Not really sure what you are trying to do here.
like in keycodes such as in javascript dt i can make a script if you press dat button this wil happen

Frank
07-16-2006, 03:41 PM
You can't do that with PHP. PHP is a server-side language. You will have to use a client-side language such as Javascript to detect keystrokes.