The php script is working fine, unitll it reach fopen(); After that all execution of the script stoped.
- Code: Select all
- <?
 error_reporting(0);
 $user = $_GET["user"]; $id = $_GET["pass"]; $err = 0;
 if (empty($user) == True) { $user = $_POST["user"]; if (empty($user) == True) { $err = 1; } }
 if (empty($id) == True) { $id = $_POST["id"]; if (empty($id) == True) { $err = 1 ; } }
 if ($err == 0) {
 include("info/".$user.".php");
 if (empty($member_ok) == True) { $err = 1; }
 }
 ?>
 <html>
 <head>
 <link title="Test" href="style.css" type="text/css" rel="stylesheet">
 </head>
 <body>
 <h2><b>FreeNet web admin</b></h2>
 <hr color="#0099FF">
 <?
 if ($err == 1) {
 print('Nimate dovoljenja za dostop... Treba bo se <a href="/freenetwadmin/index.php">loginat.</a><script>');
 print("self.parent.location='/freenetwadmin/index.php';</script>");
 }
 else {
 print("<h3>Dobrodosel ".$user."</h3>");
 print('<table width="100%"><tr><td width=200 valign="top">');
 $i = 0; include("info/settings/menu.php");
 while ($i <= $max) {
 $i++;
 if (empty($page[$i]) != True) {
 if ($prio[$i] <= $priority_d) { print('<big><b><a href="'.$page[$i].'?user='.$user.'&pass='.$id.'">'.$site[$i].'</a><br></b></big>'); print("\n"); }
 }
 }
 print('</td><td width=15> </td><td valign="top">');
 include("info/settings/config.php");
 $posted = $_POST["post_ed"]; $err = 0; $fp = "w"; $txt = $_POST["conf_t"];
 if (empty($posted) == True) { $err = 1; $fp = "r"; }
 $handle = fopen($conffile, $fp);
 $text = fread($handle, filesize($conffile));
 if (empty($posted) == False) {
 fwrite($handle, $txt);
 $text = $txt;
 }
 fclose($handle);
 if (empty($posted) == False) { print("<b>Datoteka updetana!</b><br><br>"); }
 print("Konfiguracija <b>".$conffile."</b><br><br>");
 print('<form method="post" action="ircd_confc.php?user='.$user.'&pass='.$id.'"><input type="hidden" name="post_ed" value="1">');
 print('<textarea name="conf_t" class="button" rows=25 cols=100>');
 print($text);
 print('</textarea><br><br><input type="submit" value=" Update datoteko " class="button"></form>');
 print("</td></tr></table>");
 }
 ?>
 </body>
 </html>
I'm still newbie to php...




