imname
January 22nd, 2008, 04:28 AM
I would like to write "1234" to Command.txt when I click the OKbutton.
However I cant get what I expected...anyone can help me please???
<?php
function WriteCommFile($command){
$file="Command.txt";
$handle = fopen($file, "w+");
if($handle==false){
die("unable to create file");
}else{
$data=$command;
fwrite($handle,$data);
fclose($handle);
}
}
echo "<button onclick='WriteCommFile(1234)'>OK</button>";
?>
However I cant get what I expected...anyone can help me please???
<?php
function WriteCommFile($command){
$file="Command.txt";
$handle = fopen($file, "w+");
if($handle==false){
die("unable to create file");
}else{
$data=$command;
fwrite($handle,$data);
fclose($handle);
}
}
echo "<button onclick='WriteCommFile(1234)'>OK</button>";
?>