ruby159
Gebruiker
- Lid geworden
- 6 jan 2007
- Berichten
- 98
hey,
ik heb een probleem met een schijf actie in een tekstbestand
dit is mijn script:
Het werkt allemaal prima hij schijft netjes in rcon.txt
MAAR
Hij gaat ook schrijven als je niks invult en niet op de button klikt
Hoe kan ik het maken dat php alleen gaat schrijven als er op de button geklikt word (ik denk persoonlijk dat het makkelijk optelossen is maar ik kan er niet zo op komen)
(ps. als ik het alles wat in form staat boven het schijf scripts plaats gaat ie ook schijven zonder dat er op de button word geklikt)
Ruby:thumb:
ik heb een probleem met een schijf actie in een tekstbestand
dit is mijn script:
PHP:
<?php error_reporting(0);?>
<?php include ("inc_connect_sqlite.php");?>
<?php include ("inc_logged_in.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p align="center"><img src="images/banner.gif" width="1200" height="200" />
<?php
$myFile = "rcon.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "rcon_password $_POST[rcon]\n";
fwrite($fh, $stringData);
fclose($fh);
?>
<form id="form1" name="form1" method="post" action="">
<p>Rcon password:
<input type="password" name="rcon" id="rcon"/>
</p>
<p>
<input type="submit" name="send" id="send" value="Submit" />
<input type="reset" name="clear" id="clear" value="Reset" />
</p>
</form>
<p><a href="index.php">Back to index </a></p>
<p>Copyright © 2007 Ruby159</p>
<p> </p>
</body>
</html>
Het werkt allemaal prima hij schijft netjes in rcon.txt
MAAR
Hij gaat ook schrijven als je niks invult en niet op de button klikt

Hoe kan ik het maken dat php alleen gaat schrijven als er op de button geklikt word (ik denk persoonlijk dat het makkelijk optelossen is maar ik kan er niet zo op komen)
(ps. als ik het alles wat in form staat boven het schijf scripts plaats gaat ie ook schijven zonder dat er op de button word geklikt)
Ruby:thumb: