SELFPHP: Version 5.8.2 Befehlsreferenz - Tutorial – Kochbuch – Forum für PHP Einsteiger und professionelle Entwickler

SELFPHP


Professional CronJob-Service

Suche



CronJob-Service    
bei SELFPHP mit ...



 + minütlichen Aufrufen
 + eigenem Crontab Eintrag
 + unbegrenzten CronJobs
 + Statistiken
 + Beispielaufrufen
 + Control-Bereich

Führen Sie mit den CronJobs von SELFPHP zeitgesteuert Programme auf Ihrem Server aus. Weitere Infos



:: Buchempfehlung ::

Webseiten professionell erstellen

Webseiten professionell erstellen zur Buchempfehlung
 

:: Anbieterverzeichnis ::

Globale Branchen

Informieren Sie sich über ausgewählte Unternehmen im Anbieterverzeichnis von SELFPHP  

 

:: Newsletter ::

Abonnieren Sie hier den kostenlosen SELFPHP Newsletter!

Vorname: 
Name:
E-Mail:
 
 

Zurück   PHP Forum > SELFPHP > PHP Grundlagen
Hilfe Community Kalender Heutige Beiträge Suchen

PHP Grundlagen Hier kann über grundlegende Probleme oder Anfängerschwierigkeiten diskutiert werden

Antwort
 
Themen-Optionen Ansicht
  #1  
Alt 10.08.2011, 00:25:24
Sebi3 Sebi3 ist offline
Anfänger
 
Registriert seit: Aug 2011
Alter: 37
Beiträge: 2
Nav funktioniert nicht mehr nach Formular abschicken

Schönen guten Abend zusammen.
Habe ein kleines Problem mit PHP. Wenn ich mein Kontaktformular absende, dann funktioniert aus irgendeinem Grunde das Nav mit seinem Farbwechsel nicht mehr, sobald die Erfolgsmeldung oder Fehlermeldung über den Versand mittels der mail-Funktion erscheint.

Der ganze Javascript-Code habe ich rausgenommen, er funktioniert ohne Probleme.

Vielen Dank im Vorraus für eure Hilfe.

MfG Sebi


Hier die Dateien:

Kontakt.php:
PHP-Code:
<?php 
$email 
"test@gmx.de";
$subject "neue Kontaktmitteilung auf Website: Test GmbH";
$name "Mustermann";
$website "www.test.de";
?> 

<!DOCTYPE>
<html>
    <head>
    <meta charset="ISO-8859-1">
    <link rel="SHORTCUT ICON" type="image/png" href="/favicon.png">
    <link rel="stylesheet" type="text/css" href="/CSS/Self-CSS.css">
    <title> Test GmbH - Kontakt </title>
    
    <script charset="utf-8" src="http://code.jquery.com/jquery-1.6.1.min.js"> </script>

        <script>
            ...
        </script>
    </head>
    <body>
          <div id="logo"> <img src="./Logo/Logo.jpg" alt="Logo" title="Logo"></div>
          <div id="top-background"> </div>
          <header>
              <nav>
                <ul>
                    <li> <a href="Index.html"> Home </a> </li>
                    <li> <a href="Aktuelles.html"> Aktuelles </a> </li>
                    <li> <a href="Unternehmen.html"> Unternehmen </a> </li>
                    <li> <a href="Impressum.html"> Impressum </a> </li>
                    <li class="selected" id="last-child"> <a href="Kontakt.php"> Kontakt </a> </li>
                </ul>
            </nav>
        </header>
        
        
        <?php 
            
if(empty($_POST['abschicken'])) {
                echo 
'<br>
                        <br>
                        <br>
                        <div> <h1> <nobr> Haben Sie Fragen, Anregungen oder Kritik? </nobr> </h1> </div>
                        <br>
                        <form action="/Kontakt.php" method="POST" name="kontaktformular" id="kontaktformular" onsubmit="return validateMessage();">
                        <div class="form"> 
                        <label for="Anrede"> Anrede* </label> 
                        <select id="anrede" onchange="Anredetyp();"> <option> Frau </option>
                                 <option> Herr </option>
                                 <option> Familie </option>
                                 <option> Firma </option> </select> <br />
                        <input type="hidden" name="anrede" id="anredetrans" value="Frau">
                        <label for="Titel"> Titel </label>  
                        <input type="text" name="titel" maxlength="40" size="50"> <br />      
                        <label for="Name" id="nametitle"> Name* </label>
                        <input type="text" id="name" name="name" maxlength="40" size="50" onkeydown="nameChange();"> <br />
                        <h2 id="name-error" style="display:none; color:red;"> Sie haben vergessen Ihren Nachnamen/Firmennamen einzugeben! </h2>
                        <label for="Vorname" id="vornametitle"> Vorname* </label>
                        <input type="text" name="vorname" id="vorname" maxlength="40" size="50" onkeydown="vornameChange();"> <br />
                        <h2 id="vorname-error" style="display: none; color: red;"> Sie haben vergessen Ihren Namen einzugeben! </h2> 
                        <label for="Straße"> Straße / Haus-Nr. </label>
                        <input type="text" name="straße" maxlength="40" size="42">
                        <input type="text" name="hausnr" maxlength="5" size="1"> <br />
                        <label for="PLZ"> PLZ / Ort </label>
                        <input type="text" name="plz" maxlength="5" size="2">
                        <input type="text" name="ort" maxlength="40" size="41"> <br />
                        <label for="Telefon"> Telefon </label>
                        <input type="text" name="telefon" maxlength="30" size="50"> <br />
                        <label for="Telefax"> Telefax </label>
                        <input type="text" name="telefax" maxlength="30" size="50"> <br />
                        <label for="Handy"> Handy </label>
                        <input type="text" name="handy" maxlength="30" size="50"> <br />
                        <label for="E-Mail" id="emailtitle"> E-Mail* </label>
                        <input type="text" name="email" maxlength="30" size="50"  id="email" onkeydown="emailChange();"> <br />
                        <h2 id="email-error" style="display:none; color:red;"> Sie haben vergessen Ihren E-Mail einzugeben! </h2> 
                        <h2 id="validate-email-error" style="display:none; color:red;"> Sie haben eine falsche E-Mail Adresse eingeben! </h2> 
                    </div>
                    <div class="clear">&nbsp;</div> 
                    <div id="display"> 1000 Zeichen </div>         
                    <div class="form"> 
                        <label for="Nachricht" id="messagetitle"> Ihre Nachricht* </label>
                        <textarea name="message" id="message" onFocusIn="blank();" onkeyup="display();" onkeydown="display();">Ihre Nachricht an uns!</textarea> <br />
                        <div id="message-length-error"> </div> 
                    </div>     
                    <div id="submitbutton">
                        <h2 id="message-error" style="display: none; color: red;"> Sie haben vergessen Ihre Nachricht an uns einzugeben! </h2> 
                        <input type="submit" id="submit" name="abschicken" value="Nachricht abschicken" class="button">
                        <br>
                        <p> Pflichtangaben sind mit * gekennzeichnet! </p>
                    </div>                    
                </form>
                <br>'
;
            }
            
            else {
                
$abs_anrede $_POST['anrede'];
                
$abs_titel $_POST['titel'];
                
$abs_name $_POST['name']; 
                
$abs_vorname $_POST['vorname'];
                
$abs_straße $_POST['straße'];
                
$abs_hausnr $_POST['hausnr'];
                
$abs_plz $_POST['plz'];
                
$abs_ort $_POST['ort'];
                
$abs_telefon $_POST['telefon'];
                
$abs_telefax $_POST['telefax'];
                
$abs_handy $_POST['handy'];
                
$abs_email $_POST['email'];  
                  
$abs_message $_POST['message']; 
                                    
                  
$message "Hallo $name!\n\n $abs_anrede $abs_name hat dir auf deiner Website per Kontaktformular folgenden Text geschickt:\n _______\n$abs_message\n_______\n"
  
                 
$senden mail($mail$subject$message,"From: $abs_email"); 
                 
                 if(
$senden){
                    echo 
'<div class="form"> <h3> Ihre Nachricht wurde erfolgreich an uns versandt. Vielen Dank! <br> Wir werden in Kürze mit Ihnen Kontakt aufnehmen. </h3> </div>'
                 } 
  
                 else {
                    echo 
'<div class="form"> <h3 style="color: red"> Ihre Nachricht konnte aufgrund eines technischen Fehlers leider nicht an uns versandt werden. Probieren Sie es bitte zu einem späteren Zeitpunkt noch einmal oder auf den sonstigen <a href="Impressum.html"> Kommunikationswegen. </a> </h3> </div>';
                  } 
            }
        
?>
    </body>
</html>
Self-CSS.css:
Code:
/* General */
html {
	background: #686868;
}
			
body {
	margin: 5px auto;
	background: white;
	height: auto;
	width: 1024px;
	max-width: 1024px;
	border-top-left-radius: 15px;
	border-top-right-radius: 15px;
	box-shadow: 0px 5px 10px 10px black;
	border: 10px;
	border-color: black;
}
			
body>:first-child {
	margin: 0;
	padding-top: 1em;
}

body>p {
	padding-left: 50px;
	padding-right: 50px;
}


#logo img {		
	float: left;
	margin-top: -10px;
	width: 300px;
	height: 160px;
	border-top-left-radius: 15px;
}

#logo {
	color: white;
	position: absolute;
}
			
#top-background {
	margin: 0 0 0 300px;
	background-image:url("/top.jpg");
	height: 180px;
	width: 724px;
	border-top-right-radius: 15px;
	border-top-left-radius: 15px;
}

/* Navigation */
header nav, header nav ul{
	position: relative;
	width: 1025px;
	background-color: black;
	padding: 0;
	margin: 0;	
}
			
header nav li {
	padding-right: 2px;
	list-style: none;
	float: left;
	background-color: black;	
	text-align: center;
	color: white;	
	margin: 0px 0px 10px 0px;
	font-size: 20px;
	width: 203px;
}

#last-child {
	width: 204px;
	padding-right:0px;
}

header nav a:link, header nav a:visited {
	background: black;
	color: white;	
	font-size: 16px;
	width: 204px;
	font-family: Verdana;
	font-weight: bold;
	text-decoration:none;
	height: 30px;
	position: absolute;
	padding: 10px 0 0 0;
}
		
header nav a:link {
	margin: 0 0 10px 0;
}
			
header nav a:hover {
	color: white;
	background: #006699;
	background: -moz-linear-gradient(top, #006699 1%, #030066 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#006699), color-stop(100%,#030066));
	background: -webkit-linear-gradient(top, #006699 1%,#030066 100%);
	background: -o-linear-gradient(top, #006699 1%,#030066 100%);
	background: -ms-linear-gradient(top, #006699 1%,#030066 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#006699', endColorstr='#030066',GradientType=0 );
	background: linear-gradient(top, #006699 1%,#030066 100%);
}

.selected, header nav ul .selected a {
	background: #006699;
	background: -moz-linear-gradient(top, #006699 1%, #030066 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#006699), color-stop(100%,#030066));
	background: -webkit-linear-gradient(top, #006699 1%,#030066 100%);
	background: -o-linear-gradient(top, #006699 1%,#030066 100%);
	background: -ms-linear-gradient(top, #006699 1%,#030066 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#006699', endColorstr='#030066',GradientType=0 );
	background: linear-gradient(top, #006699 1%,#030066 100%);
}

			
/* Kontakt */

div h1 nobr {
	font-family: Verdana;
	font-size: 18px;
	padding: 300px;
}

.form, #submitbutton{
	position: relative;	
	padding-left: 90px;
	padding-top: 20px;
}

form#kontaktformular {
	width: 650px; 
	margin-left: 200px; 
	border: 1px #c4c4c4 solid;
}

form#kontaktformular label { 
	width: 160px; 
	height: 22px; 
	margin-top: 5px; 
	display: block; 
	float: left; 
	font-family: Verdana;
	font-size: 14px;
}
form#kontaktformular #display {
	padding-right: 60px;
	color: #888888;
	text-align: right;
	margin-bottom: -15px;
}


form#kontaktformular textarea { 
	max-width: 340px;
	width: 340px;
	height: 160px; 
	border: 1px #c4c4c4 solid; 
	margin-top: 5px; 
	font-family: Verdana; 
	font-size: 14px; 
	float: left; 
	margin-bottom: -5px;
}

form#kontaktformular #submit {
	margin-right: 60px;
	float:right;
}

form#kontaktformular br { 
	clear: both; 
}

form#kontaktformular p {
	font-family: Verdana;
	font-size: 13px;	
}

form#kontaktformular h2 {
	font-size: 12px;
	font-family: Verdana;
	padding-left: 161px;
}

.form h3 {
	margin-right: 100px;
	padding-top: 180px;
	text-align: center;
	font-size: 18px;
	font-family: Verdana;
}
Mit Zitat antworten
  #2  
Alt 11.08.2011, 01:23:25
Sebi3 Sebi3 ist offline
Anfänger
 
Registriert seit: Aug 2011
Alter: 37
Beiträge: 2
AW: Nav funktioniert nicht mehr nach Formular abschicken

Nabend zusammen, habe gerade per Zufall eine Lösung auf mein Problem gefunden. Habe einfach einen Anker bei der letzten If-Else-Bedingung reingemacht und es funktioniert. Den Sinn muss man wohl manchmal nicht verstehen. :(

Gruß Sebi
Mit Zitat antworten
Antwort

Stichworte
kontaktformular, mail-funktion, php


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind aus.
[IMG] Code ist aus.
HTML-Code ist aus.

Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
js-onclick in formular funktioniert nicht tobydom PHP Grundlagen 2 20.01.2009 15:04:15
PHP Formular funktioniert im IE nicht PHPnewbie369 PHP Grundlagen 3 16.07.2007 00:58:45
Formular per Textlink abschicken µaTh PHP Grundlagen 3 02.09.2006 01:02:03
Formular als email mit Cc: funktioniert nicht gastinfo PHP für Fortgeschrittene und Experten 4 16.04.2003 13:07:41
Formular beim Laden abschicken ProGamer11 PHP Grundlagen 6 26.11.2002 15:05:06


Alle Zeitangaben in WEZ +2. Es ist jetzt 19:33:42 Uhr.


Powered by vBulletin® Version 3.8.3 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.


© 2001-2024 E-Mail SELFPHP OHG, info@selfphp.deImpressumKontakt