kostenloser Webspace werbefrei: lima-city


Kontakt Formular fehler!

lima-cityForumProgrammiersprachenPHP, MySQL & .htaccess

  1. Autor dieses Themas

    d*********m

    Also ich habe 2 probleme Nr.1 auf meiner page http://dumdididunm.pyrokar.lima-city.de/page/index.php?switch=contact habe ich per php switch die seite http://dumdididunm.pyrokar.lima-city.de/page/php/kontact2.php rein gekloppt doch das kontakt formular hat ebenfals ein php switch und nun wollen die ******* net richtig zusammen arbeiten :) also wie mache ich es der mir auf die index.php die kontact2.php includet aber auch gleichzeitig wenn ich auf "submin" klicke der mir wieder in dem php-swicht noch einen php-switch macht :) Nr. 2 in der zeile 104 " header("Location: ".$PHP_SELF."?switch=default".$error);" ist angeblich ein fehler... aber ich sehe da keinen! der kommt wenn ich direkt die kontact2.php aufrufe und da auf "submin" klicke!!! ich hoffe jemand kann mir helfen

    Das Kontakt Formular:

    <? ob_start();
    include("config_mail.php");

    echo '<html>
    <title>Contact Formular</title>
    <head>';
    echo '<style type="text/css">
    TD {FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 11px; color: '.$textcolor.'}
    A:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; line-height: normal; color: '.$linkcolor.'; text-align: center; }
    A:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; line-height: normal; color: '.$linkcolor.'; text-align: center; }
    A:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; line-height: normal; color: '.$linkcolor.'; text-align: center; }
    A:active { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; line-height: normal; color: '.$linkcolor.'; text-align: center; }
    </style>
    <style type="text/css">
    INPUT { font-size: 10px; color: #000000; background-color: '.$color2.'; border: 1px solid #000000; }
    </style>
    </head>

    <body bgcolor="'.$color1.'" text="'.$textcolor.'">';

    switch($switch) {
    default:
    echo '<center>
    <table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td vAlign="top"><center>'.$kontakttxt.'</center><br><br>
    <center><table border="0" width="200" height="200" cellspacing="0" cellpadding="4">
    <tr>
    <td>Name:</td>
    <td>
    <form action="'.$PHP_SELF.'?switch=kontakt" method="post">
    <input type="text" name="nick" size="16">';
    if($pnick=="no"){ echo ' <font color="red">Fail</font>'; }
    echo '</td>
    </tr>
    <tr>

    <td>E-mail:</td>
    <td><input type="text" name="email" size="16">';
    if($pemail=="no"){ echo ' <font color="red">Fail</font>'; }
    echo '</td>
    </tr>
    <tr>

    <td>Betreff:</td>
    <td><input type="text" name="icq" size="16">';
    if($pbetreff=="no"){ echo ' <font color="red">Fail</font>'; }
    echo '</td>
    </tr>
    <tr>

    <td>Text:</td>
    <td><input type="text" name="text" size="16">';
    if($ptext=="no"){ echo ' <font color="red">Fail</font>'; }
    echo '</td>
    </tr>
    <tr>

    <td>?</td>
    <td><input type="submit" value="Submit"> <input type="reset" value="Reset"><input type="hidden" name="sid" value="5c229af6a9ab48c4a33ea6c53c27f5c1"></form></td>
    </tr>
    </table>
    </center></td>
    </tr>
    </table>
    </center>';

    break;

    case "kontakt":
    if(trim($nick)!="" && trim($betreff)!="" && trim($email)!="" && trim($text)!=""){


    $message="Eine E-Mail von $nick \n

    Nick: $nick \n
    E-mail: $email \n
    Was er sagen m?chte: \n
    $text \n
    MFG $nick";

    $subject="$nick | $betreff";
    mail($to_email,$subject,$message,"From: $email");

    echo '<center>
    <table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td vAlign="top"><center><table border="0">
    <tr>
    <td>Deine Email wurde erfolgreich versand!</td>
    </tr>
    </table></center>
    </td>
    </tr>
    </table></center>';

    }
    else {
    if(trim($nick)==""){ $error = "&pnick=no"; }
    if(trim($betreff)==""){ $error .= "&pbetreff=no"; }
    if(trim($email)==""){ $error .= "&pemail=no"; }
    if(trim($text)==""){ $error .= "&ptext=no"; }
    header("Location: ".$PHP_SELF."?switch=default".$error);
    }
    breaK;
    }

    ?>

    Der php-switch in meiner index.php:

    <? switch($switch){
    case "home": include("shownews.php"); break;
    case "3d": include("php/3d.php"); break;
    case "schule": include("php/schule.php"); break;
    case "about": include("php/about.php"); break;
    case "down": include("php/down.php"); break;
    case "links": include("php/links.php"); break;
    case "contact": include("php/kontact2.php"); break;
    case "ogame": include("php/ogame.php"); break;
    default: include("php/shownews.php"); break;
    }?>

    Beitrag ge?ndert am 2.12 19:57 von dumdididunm
  2. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

  3. also zum 2 problem:

    du hast den header befehl benutzt nachdem das script schon was an den browser gesendet hat..das geht nicht!

    entweder du machst eine meta weiterleitung oder du schreibst den header befehl vor die ausgabe
  4. Autor dieses Themas

    d*********m

    naja darf hirmit bekannt geben das alles so funst wie es soll :) das 2. problem war nur ein tippfehler! ( den ich ca. 3st lang gesucht habe :) ) und das mit dem php-switch habe ich in meinen main-php-switch in meiner index.php einbebaut :)

    Edit jacr :biggrin:
    Hallo Mods!
    Es geht. :xyxthumbs:

    Na, dann wollen wir es mal schliessen.

    Beitrag ge?ndert am 2.12 23:30 von jacr
  5. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

Dir gefällt dieses Thema?

Über lima-city

Login zum Webhosting ohne Werbung!