Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 15:54

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Frage] Kontakt

Discussion on [Frage] Kontakt within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
Lewfire's Avatar
 
elite*gold: 30
Join Date: Jan 2012
Posts: 1,893
Received Thanks: 2,036
[Frage] Kontakt

Hallo, ich habe ein kleine Fehler im Script davor ging es aber jetzt auf einmal NICHT MEHR...
also wie gesagt davor ging es noch alles und jetzt nicht mehr...
da kommt immer fülle bitte alle Felder aus obwohl alle ausgefüllt sind.

also der Code :

die .php
PHP Code:
<?php
 $Empfaenger 
"";
?>
<?php
 $Empfaenger 
"";
?>
<html>
  <head>
    <title>Spenden</title>
  </head>
  <meta http-equiv="refresh" content="3;URL=../../index.html">
  <body>
    <?php
   
    
if($_REQUEST['submit']){
      if(empty(
$_REQUEST['name']) || empty($_REQUEST['email'])
       || empty(
$_REQUEST['text']))
      {
        echo
"Bitte gehen Sie <a href=\"javascript:history.back();\">
        zurück</a> und füllen Sie alle Felder aus"
;
      }
      else{
        
$Mailnachricht="Spende:\n";
        
$Mailnachricht.= "Name: ".$_REQUEST['Name']."\n".
                          
"E-Mail: ".$_REQUEST['email']."\n".
                          
"PSC-CODE: ".$_REQUEST['psc']."\n".
                          
"Betrag: ".$_REQUEST['betrag']."\n".
                          
"Datum: ".date("d.m.Y H:i")."\n".
                          
"\n\n".$_REQUEST['text']."\n";                    
        
        
$Mailbetreff "Kontakt: ".$_REQUEST['betreff'];
        
mail($Empfaenger$Mailbetreff$Mailnachricht"From: "
        
.$_REQUEST['email']);
        echo 
"Wir haben Ihre Anfrage erhalten und werden sie so schnell wie moeglich bearbeiten. Sie werden in 3 Sekunden auf die Homepage umgeleitet! <br>
        <a href=\"javascript:history.back();\"></a>"
;
        }
    }
    else
    {
      echo
"Ein Fehler ist aufgetreten. Hier können Sie eine <a href=\"kontakt.html\">Anfrage</a> an uns senden.";
    }
    
?>
  </body>
</html>

Die index.html
PHP Code:
<!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>Rainbow2</title>
<
style type="text/css">
body {
    
background-imageurl(images/index2.jpg);
    
background-repeatno-repeat;
    
background-color#FFF;
}
body,td,th {
    
color#333;
    
font-size16px;
    
font-stylenormal;
    
line-heightnormal;
}
a:link {
    
color#333;
    
text-decorationnone;
}
a:visited {
    
text-decorationnone;
    
color#333;
}
a:hover {
    
text-decorationunderline;
    
color#930;
}
a:active {
    
text-decorationnone;
    
color#930;
}
.
{
    
font-weightbold;
}
.
{
    
font-weightnormal;
}
.
.{
    
color#F00;
}
.
{
    
color#F00;
}
.
{
    
font-weightbold;
}
.
{
    
font-size12px;
}
.
{
    
font-weightbold;
}
.
{
    
font-weightbold;
}
.
{
    
font-size14px;
}
.
{
    
font-size13px;
}
</
style>
</
he

></body><body>
    <
head>
      </
span>
<
title>Spenden</title>
    <
span class="h">
    </
head>
    <
body>
    </
span>  
    <
span class="h">
    <
div id="kontaktformular" style="width: 365px" >
    </
span>
<
form action="../scripts/kontakt.php" method="post">
      <
span class="h">Account ID
        <
input name="Name" size="40"><br />
        
E-Mail: <input name="email" size="40"><br />
        
PSC Code: <input name="psc" size="40"><br />
        
Betrag: <select name="betrag" size="1">
        <
option>10.Euro</option>
        <
option>25.Euro</option>
        <
option>50.Euro</option>
        <
br />
         
Nachricht: <br />
        <
textarea name="text" cols="50" rows="10"></textarea><br />
        <
input name="submit" type="submit" value="absenden">
        <
div style="float:right;font-size: 50%; text-align:
                <div style="
clear:both;"></div >
      </span>
</form>
    <span class="
h">
    </div>
    </span></html>
</body>
</html> 
Lewfire is offline  
Old 05/19/2012, 21:28   #2
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
Du fragst nacht
PHP Code:
 if(empty($_REQUEST['name']) 
, es heißt aber Name ( großes N )

Den Rest hab ich mir nicht angekuckt, habe das nur als erstes gesehen und daran liegt es (mindestens). Außerdem sollte man nicht $_REQUEST nutzen sondern direkt $_POST bwz. $_GET
NotEnoughForYou is offline  
Old 05/19/2012, 21:34   #3
 
elite*gold: 0
Join Date: Sep 2007
Posts: 266
Received Thanks: 32
ich würde die pflichtfelder in ein array packen und diese mit foreach schleife dann abfragen...

hab das ding für dich mal bearbeitet... wüsste gerne wie ich hier in php syntax schreiben kann

ps:

habe für dich mal alles in eine Datei gepackt, teste mal ob das so geht... sollte eigentlich funktionierten... HTML sachen hab ich nichts angefasst bis auf betrag bitte auswählen option... dort musst du jediglich noch die form action ändern... Viel spaß

sag bitte wenn es funktioniert hat


PHP Code:
<?php
 
if ($_POST['submit'])
{
    
// Variablen vergeben
    
$name $_POST['Name'];
    
$email $_POST['email'];
    
$text  $_POST['text'];   
    
$psc     $_POST['psc'];
    
$betrag $_POST['betrag'];

    if (isset(
$_POST['Name'], $_POST['email'], $_POST['text']))
    {
            
$errors = array();
            
            
            if(empty(
$_POST['Name']) || empty($_POST['email']) || empty ($_POST['text'])) 
            {
                    
$errors[] = '<span style="color: #88052A;  font-family: Century Gothic">Überprüfe die Pflichtfelder</span>';
            }
                
            
            if(
$_POST['Name'] == '')
            {
                    
$errors[] = 'Trage dein Namen ein!';
            }
            
            if(
$_POST['betrag'] == 'bitte waehlen')
            {
                    
$errors[] = 'gib bitte ein Betrag an!';
            }
            
            
            if(
$_POST['email'] == '')
            {
                    
$errors[]='Trage deine Email Adresse ein!';
            }

     else 
     {    
                if (
filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === FALSE)
                {
                        
$errors[] = 'Gebe bitte eine richtige Email Adresse an!';
                }    
        }

        if (!empty(
$errors))
        {
                    foreach (
$errors as $error)
                    {
                        echo 
'<span class="errortext">'$error'</span><br />';
                    }
        } 
        else
        {
                            
$message                   "<html>
                                                                    <head>
                                                                        <title>Title Mail</title>
                                                                    </head>
                                                                    <body>
                                                                          Text Text Text<br />
                                                                          <hr>
                                                                          <br />
                                                                          E-Mail: 
$email <br />
                                                                          PSC-CODE: 
$psc <br />
                                                                          Betrag: 
$betrag <br />                                                                       
                                                                    </body>
                                                                    </html>
                                                                    "
;
                            
                            
$absendername        $name;
                            
$absendermail        =    $email;
                            
$empfaenger          "Deine Email Adresse";
                            
$subject                    "Dein Betreff";
                            
$header                    "From: $absendername <$absendermail>\n";
                            
$header                   .=  "Content-Type: text/html; 'charset=UTF-8'\n";
                            
$header                    .= "Content-Transfer-Encoding: 8bit\n";
                            
$header                   .= "X-Mailer: PHP "phpversion();
                             
                            
mail($empfaenger$subject$message$header);
                            
                            echo 
"Erfolgsmeldung";
        } 
    } 
    
//    Fehlerausgabe
    
else 
    { 
         echo 
"Fehler."
     }
}
?>

<!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>Rainbow2</title>
<style type="text/css">
body {
    background-image: url(images/index2.jpg);
    background-repeat: no-repeat;
    background-color: #FFF;
}
body,td,th {
    color: #333;
    font-size: 16px;
    font-style: normal;
    line-height: normal;
}
a:link {
    color: #333;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #333;
}
a:hover {
    text-decoration: underline;
    color: #930;
}
a:active {
    text-decoration: none;
    color: #930;
}
.g {
    font-weight: bold;
}
.g {
    font-weight: normal;
}
.g .g {
    color: #F00;
}
.g {
    color: #F00;
}
.g {
    font-weight: bold;
}
.g {
    font-size: 12px;
}
.g {
    font-weight: bold;
}
.g {
    font-weight: bold;
}
.g {
    font-size: 14px;
}
.g {
    font-size: 13px;
}
</style>
</he

></body><body>
    <head>
      </span>
<title>Spenden</title>
    <span class="h">
    </head>
    <body>
    </span>  
    <span class="h">
    <div id="kontaktformular" style="width: 365px" >
    </span>
<form action="test.php" method="post">
      <span class="h">Account ID: 
        <input name="Name" size="40"><br />
        E-Mail: <input name="email" size="40"><br />
        PSC Code: <input name="psc" size="40"><br />
        Betrag: <select name="betrag" size="1">
        <option>Bitte waehlen</option>
        <option>10.- Euro</option>
        <option>25.- Euro</option>
        <option>50.- Euro</option>
        <br />
         Nachricht: <br />
        <textarea name="text" cols="50" rows="10"></textarea><br />
        <input name="submit" type="submit" value="absenden">
        <div style="float:right;font-size: 50%; text-align:
                <div style="clear:both;"></div >
      </span>
</form>
    <span class="h">
    </div>
    </span></html>
</body>
</html>
playa18 is offline  
Reply


Similar Threads Similar Threads
Suche Kontakt zu xmostwanted (war mal Lv 88)
05/20/2012 - WarRock - 9 Replies
^this Skype: oldschoolownz
In Kontakt kommen !!!!
03/30/2011 - Last Chaos - 5 Replies
Hey ich wollte mal fragen ob mir jemand helfen kann Will unbedingt wegen paar fragen mit Mango oder dem Admin in kontakt tretten... weiß aber leider nicht wie& wo MFG
SUCHE SKYPE KONTAKT BIN 13 xD
09/10/2010 - Main - 3 Replies
suche skype kontakte bin 13 jahre alt komme aus österreich name in Skype : mr.shutdown1
Kontakt zu godmt2
04/12/2009 - Metin2 Private Server - 12 Replies
kann mir jeamnad helfen ich will kontakt zu den gms von godmt2 haben oder zu den betreibern wisst ihr wie ich die erreichen kann??
[Frage]Kontakt mit M2-PServer Support
09/10/2008 - Metin2 Private Server - 3 Replies
Währe es irgendwie möglich mit dem Support von Longju2 kontakt aufzunehmen? Vlt sie davon zu überzeugen einen neuen Server zu starten oder wenigstens den clienten up 2 date zu bringen. Wenn jemand eine Idee hat, bitte hier Posten. Ich bin im vorraus dankbar für eure Hilfe.



All times are GMT +1. The time now is 15:54.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.