Wenn ich mit dem formular eine datei erstelle die bereits existiert überschreibt es diese aber erstellt aus irgendeinem grund auch eine 2te datei ohne name in welcher nur
Filialen:
Ort:
Straße:
Telefon:
Letzte Prüfung:
Nächste Prüfung:
das zu sehen ist.
ich finde und finde denn fehler einfach nicht vielleicht kann mir ja jemand sagen was ich übersehe das währe super vielen dank schonmal o_o
Filialen:
Ort:
Straße:
Telefon:
Letzte Prüfung:
Nächste Prüfung:
das zu sehen ist.
ich finde und finde denn fehler einfach nicht vielleicht kann mir ja jemand sagen was ich übersehe das währe super vielen dank schonmal o_o
PHP-Code:
<?php
include 'dbc.php';
page_protect();
?>
<?php
$ort = "filiale.php";
?>
<html>
<head>
<title>My Account</title>
<meta charset="utf-8" />
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body id="wrapper">
<div id="menu">
<?php
if (isset($_SESSION['user_id'])) {?>
<div class="myaccount">
<p><strong>Menü</strong></p>
<a href="myaccount.php"><div class="acc_menu">My Account</div></a><br>
<a href="filialenform.php"><div class="acc_menu">Filialen</div></a><br>
<a href="filiale.php"><div class="acc_menu">Neue Filiale</div></a><br>
<a href="logout.php"><div class="acc_menu">Logout </div></a>
<?php }
if (checkAdmin()) {
?>
<p id="admin"><a href="admin.php">Admin CP</a></p>
<?php } ?></div>
<p>© Drei50
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="main">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="160" valign="top">
<p> </p>
<p> </p>
<p> </p></td>
<td width="732" valign="top"><p> </p>
<h3 class="filialenhdr">Wilkommen <?php echo $_SESSION['user_name'];?></h3>
<?php
if (isset($_GET['msg'])) {
echo "<div class=\"error\">$_GET[msg]</div>";
}
?>
<p>Eine neue Filiale hinzufügen?</p>
<!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-->
<?php
$link = $_GET["link"];
$file1 = "filestmp/$link.php";
$ort = $_GET["ort"];
$straße = $_GET["straße"];
$telefon = $_GET["telefon"];
$datum = $_GET["datum"];
$datum1 = $_GET["datum1"];
$html = '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../styles.css" rel="stylesheet" type="text/css" media="screen">
<link href="../print.css" rel="stylesheet" type="text/css" media="print">';
$handle = fopen($file1,"w+");
$text =
" <html><head><?php echo '$html';?>
</head><body>
<table class='formular'>
<tr>
<td>
Filialen: <strong></br><?php echo '$link';?></strong>
</td>
<td>
Ort: <strong></br><?php echo '$ort';?></strong>
</td>
</tr>
<tr>
<td>
Straße: <strong></br><?php echo '$straße';?></strong>
</td>
<td>
Telefon: <strong></br><?php echo '$telefon';?></strong>
</td>
</tr>
<tr>
<td>
Letzte Prüfung: <strong></br><?php echo '$datum';?></strong>
</td>
<td>
Nächste Prüfung: <strong></br><?php echo '$datum1';?></strong>
</td>
</tr>
</table>
</body>";
fputs($handle,$text);
fclose($handle);
?>
<!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-->
<form action="<?=$_SERVER['PHP_SELF']?>" method="$_POST">
<table cellpadding="5" cellspacing="0" border="0" class="filiale_neu">
<tr>
<td>Filialen Nummer:</td>
<td><input type="text" name="link" size="30" maxlength="50"></td>
<td>Ort:</td>
<td><input type="text" name="ort" size="30" maxlength="50"></td>
</tr>
<tr>
<td>Straße:</td>
<td><input type="text" name="straße" size="30" maxlength="50"></td>
<td>Telefon:</td>
<td><input type="text" name="telefon" size="30" maxlength="50"></td>
</tr>
<tr>
<td>Prüftermin:</td>
<td><input type="date" name="datum" size="20"></td>
<td>Nächster Termin:</td>
<td><input type="date" name="datum1" size="20"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Abschicken"></td>
</tr>
</table>
</form>
</td>
<td width="196" valign="top"> </td>
</tr>
<tr>
<td colspan="3"><table class="formular" cellpadding="10px">
<tr>
<td>
<p>Filialen: <strong></br><?php echo $_GET['link'];?></strong></p>
</td>
<td>
<p>Ort: <strong></br><?php echo $_GET['ort'];?></strong></p>
</td>
</tr>
<tr>
<td>
<p>Straße: <strong></br><?php echo $_GET['straße'];?></strong></p>
</td>
<td>
<p>Telefon: <strong></br><?php echo $_GET['telefon']; ?></strong></p>
</td>
</tr>
<tr>
<td>
<p>Letzte Prüfung: <strong></br><?php echo $_GET['datum']; ?></strong></p>
</td>
<td>
<p>Nächste Prüfung: <strong></br><?php echo $_GET['datum1']; ?></strong></p>
</td>
</tr>
</table>
<tr> </tr>
</table>
</body>
</html>
Kommentar