Hallo,
ich habe folgendes Problem. Ich mache eine Abfrage, ob ein Eintrag in der Datenbank wirklich gelöscht werden soll. Diese kann mann dann mit einem Button "Eintrag endgültig löschen" oder "zurück zur Übersicht" beantworten mittels klick.
Das Problem ist, im Safari gehts das wunderbar. Im Firefox aber nicht. Da wird der Link nicht geöffnet.
Komisch ist nur:
Wenn der Beitrag erfolgreich gelöscht wurde, ist auch nochmal der gleiche Button "zurück zur Übersicht" vorhanden. Bei dem funktioniert es.
Hier mal der Code:
Die Form.css Datei sieht wie folgt aus:
Wie gesagt, es funktioniert nur die Sache mit dem Button zurück nicht. Der Rest geht, deshalb auch HTML Thema.
Vielen Dank schon mal
ich habe folgendes Problem. Ich mache eine Abfrage, ob ein Eintrag in der Datenbank wirklich gelöscht werden soll. Diese kann mann dann mit einem Button "Eintrag endgültig löschen" oder "zurück zur Übersicht" beantworten mittels klick.
Das Problem ist, im Safari gehts das wunderbar. Im Firefox aber nicht. Da wird der Link nicht geöffnet.
Komisch ist nur:
Wenn der Beitrag erfolgreich gelöscht wurde, ist auch nochmal der gleiche Button "zurück zur Übersicht" vorhanden. Bei dem funktioniert es.
Hier mal der Code:
PHP:
<?php session_start();
header("Content-Type: text/html; charset=utf-8");
?>
<!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>Gästebuch - Abfrage wirklich löschen</title>
<link href="/home/css/form.css" rel="stylesheet" type="text/css" />
<style type="text/css">
h1 {
font-family: "Arial Black", Gadget, sans-serif;
color: #636363;
font-size: 16px;
text-align: center;
}
h2 {
font-family: "Arial Black", Gadget, sans-serif;
color:#0066CC;
font-size: 12px;
text-align: left;
display: inline;
}
h3 {
font-family: "Arial Black", Gadget, sans-serif;
color:#00CC33;
font-size: 12px;
text-align: left;
display: inline;
}
h4 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
font-weight: bold;
color: #999999;
text-align: left;
text-decoration: none;
display: inline;
}
h5 {
font-family: "Arial Black", Gadget, sans-serif;
color:#FFFFFF;
font-size: 14px;
text-align: center;
display: inline;
}
a:link {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
font-weight: bold;
color: #999999;
text-align: left;
text-decoration: none;
}
a:visited {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
font-weight: bold;
color: #999999;
text-align: left;
text-decoration: none;
}
a:hover {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
font-weight: bold;
color: #D23600;
text-align: left;
text-decoration: none;
}
.ok
{
background-color:#00CC33;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
width:65%;
height: 30%;
text-align: center;
margin-right: auto;
margin-left: auto;
}
</style>
</head>
<body>
<?php
// Datenbank Verbindung
include('connect.php');
// Wenn Button ja betätigt
if (!isset($_POST['submit'])){
echo "<p><h1>Soll der folgende Eintrag wirklich gelöscht werden?</h1>";
echo "<br />";
$sql = " SELECT * FROM gaestebuch WHERE id='". $_GET['id'] ."'";
if ( ! $db_link )
{
die('keine Verbindung zur Zeit möglich -
später probieren ');
}
// ausführen des mysql-Befehls
$db_erg = mysql_query( $sql );
if ( ! $db_erg )
{
die('Ungültige Abfrage: Abfrage Eintrag auswählen:' . mysql_error());
}
// Alte Werte schreiben
$daten = mysql_fetch_object($db_erg);
$name = $daten->name;
$eintrag = $daten->eintrag;
// ID in Session Variable speichern
$_SESSION['id_loesch'] = $daten->id;
// Uhrzeit und Datum in deutsches Format wandeln
$datum_de = date("d.m.Y", strToTime( $daten->datum));
$uhrzeit_de = date("H:i", strToTime( $daten->datum));
// Smilies einfügen
include ('smile.php');
echo '<table width="90%" border="0" align="center">
<tr bgcolor=#F5F2CD>
<td width="10%"><h2> ID:</h2><h3> '.$daten->id.'</h3></td>
<td width="20%"><center><h3>'.$datum_de.' - '.$uhrzeit_de.'</h3></center></td>
<td width="50%"><h2> Name:</h2><h3> '.$daten->name.'</h3></td>
<td width="10%"><center>'.$freigeschalten.'</center></td>
</tr>
</table>
<table width="90%" border="0" align="center">
<tr bgcolor=#F6E6B1>
<td width="100%"> <h3>'.$inhalt.' <h3></td>
</tr>
</table>
';
// Ressource wieder freigeben
mysql_free_result( $db_erg );
}
else
{
// Session Variable zuweisen
$id = $_SESSION['id_loesch'];
//SQL Befehl
$sql = " DELETE FROM gaestebuch WHERE id = '$id' ";
if ( ! $db_link )
{
// hier sollte dann später dem Programmierer eine
// E-Mail mit dem Problem zukommen gelassen werden
// die Fehlermeldung für den Programmierer sollte
// das Problem ausgeben mit: mysql_error()
die('keine Verbindung zur Zeit möglich -
später probieren ');
}
// ausführen des mysql-Befehls
$db_erg = mysql_query( $sql );
if ( ! $db_erg )
{
die('Ungültige Abfrage Eintrag löschen: ' . mysql_error());
}
echo '<br /><div class="ok"><h5><center><br />Eintrag mit der ID: '.$_SESSION['id_loesch'].' wurde erfolgreich gelöscht</h5><br /></center></div><br /><br /><center><a href="admin_gae_loesch.php">
<input type="submit" class="button submit" name="zruck" title="zurück zur Übersicht" value="zurück zur Übersicht" /></a>';
exit;
}
?>
<form name="Formular" action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="POST" >
<p>
<table width="35%" align="center" border="0">
<tr>
<td>
<center>
<a href="admin_gae_loesch.php">
<input type="submit" class="button submit" name="zruck" title="zurück zur Übersicht" value="zurück zur Übersicht" /></a></center></td>
<td>
<center>
<input type="submit" class="buttonloesch submitloesch" name="submit" title="Eintrag endgültig löschen" value="Eintrag endgültig löschen" /></center>
</td>
</tr>
</table>
</form>
</p>
</body>
</html>
Die Form.css Datei sieht wie folgt aus:
HTML:
form.formular {
font-family: tahoma, verdana, "sans-serif";
font-size: 12px;
padding: 20px;
border: 1px solid #A5A8B8;
background: #EAEAEA;
}
form.black {
font-family: tahoma, verdana, "sans-serif";
font-size: 12px;
padding: 20px;
border: 1px solid #A5A8B8;
background:#666666;
color:#CCCCCC;
}
form.black legend{
color:#CCCCCC;
}
.formular fieldset {
margin-top: 20px;
padding : 15px;
border: 1px solid #B5B8C8;
}
.formular legend {
font-size: 12px;
color: #15428B;
font-weight: 900;
}
.formular fieldset label {
float: none;
text-align: inherit;
width: auto;
}
.formular label span {
color: #000;
}
.black label span {
color: #ccc;
}
.formular input, .formular select, .formular textarea {
display : block;
margin-bottom: 5px;
}
.formular .text-input {
width: 250px;
color: 555;
padding: 4px;
border: 2px solid #B5B8C8;
font-size: 14px;
margin-top: 4px;
background: #FFF url('/img/form/text-bg.gif') repeat-x;
}
.text-input {
width: 250px;
color: #555;
padding: 4px 4px 3px;
border: 2px solid #B5B8C8;
font-size: 14px;
margin-top: 4px;
margin-bottom: 4px;
background: #FFF url('/img/form/text-bg.gif') repeat-x;
}
.formular .capt-input {
width: 50px;
color: 555;
padding: 4px;
border: 2px solid #B5B8C8;
font-size: 14px;
margin-top: 4px;
background: #FFF url('/img/form/text-bg.gif') repeat-x;
}
.capt-input {
width: 100px;
color: #555;
padding: 4px 4px 3px;
border: 2px solid #B5B8C8;
font-size: 14px;
margin-top: 4px;
margin-bottom: 4px;
background: #FFF url('/img/form/text-bg.gif') repeat-x;
}
.formular .infos {
background: #FFF;
color: #333;
font-size: 12px;
padding: 10px;
margin-bottom: 10px;
border:1px solid #B5B8C8;
}
.formular span.checkbox,
.formular .checkbox {
display: inline;
}
.formular .button {
text-align:right;
margin-top: 20px;
}
.submit {
color: #555;
float:center;
text-decoration: none;
}
.submitloesch {
color: #F00;
float:center;
text-decoration: none;
}
.submitbearb {
color: #F90;
float:center;
text-decoration: none;
}
.submitok {
color: #0C3;
float:center;
text-decoration: none;
}
.formular a.submit {
background: url('/img/form/button-bg.png') repeat-x;
border: 1px solid #AAA;
padding: 4px;
}
input.button {
background: url('/img/form/button-bg.png') repeat-x;
border: 2px solid #AAA;
padding: 4px 4px 1px;
font-size:14px;
margin-top:4px;
}
input.buttonloesch {
background: url('/img/form/button-bg.png') repeat-x;
border: 2px solid #F00;
padding: 4px 4px 1px;
font-size:14px;
margin-top:4px;
}
input.buttonbearb {
background: url('/img/form/button-bg.png') repeat-x;
border: 2px solid #F90;
padding: 4px 4px 1px;
font-size:14px;
margin-top:4px;
}
input.buttonok {
background: url('/img/form/button-bg.png') repeat-x;
border: 2px solid #0C3;
padding: 4px 4px 1px;
font-size:14px;
margin-top:4px;
}
.formular input {
background: url('/img/form/button-bg.png') repeat-x;
border: 2px solid #AAA;
padding: 4px;
}
.formular hr {
clear: both;
visibility: hidden;
}
.formular .fc-error {
width: 350px;
color: 555;
padding: 4px;
border: 1px solid #B5B8C8;
font-size: 12px;
margin-bottom: 15px;
background: #FFEAEA;
}
form textarea {
resize: none;
}
Wie gesagt, es funktioniert nur die Sache mit dem Button zurück nicht. Der Rest geht, deshalb auch HTML Thema.
Vielen Dank schon mal