Zum Inhalt springen

Sebi80

Mitglieder
  • Gesamte Inhalte

    237
  • Benutzer seit

  • Letzter Besuch

Beiträge von Sebi80

  1. Aktuell schaut der Code so aus:

    Seite 1:


    //SESSION START
    <?
    session_start();

    ?>
    //TEXTFELDER
    <td width="195"><input type="text" name="STELLE" size="20" value="<? echo $_SESSION['S_STELLE'];?>"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt; font-weight: 400">Standort: *</td>

    <td width="195"><input type="text" name="STANDORT" size="20" value="<? echo $_SESSION['S_STANDORT'];?>"></td>
    //BUTTON
    <td width="270"><a title="Weiter"><input type="submit" value=">>" name="WEITER"></a></td>
    [/PHP]

    Seite 2:

    [PHP]
    //SESSION START
    <?
    session_start();

    $S_STELLE = $_REQUEST['STELLE'];
    $_SESSION['S_STELLE'] = $S_STELLE;
    $S_STANDORT = $_REQUEST['STANDORT'];
    $_SESSION['S_STANDORT'] = $S_STANDORT;
    $S_BART = $_REQUEST['BART'];
    $_SESSION['S_BART'] = $S_BART;

    ?>
    //WEITERE TEXTFELDER

    ...

    //BUTTONS

    <input type="submit" title="Zurück" id="1" value="<<" name="ZURUECK"><a title="Weiter"><input type="submit" id="3" value=">>" name="WEITER"></a>

    Seite 3:


    //SESSION START
    <?
    session_start();

    //SESSIONDATEN VON SEITE 2 SPEICHERN

    //WEITERE TEXTFELDER

    ...


    //BUTTONS UND HREF-LINK (Der eine Button hat den href auch noch)

    <td width="270"><a title="Zurück" href="bewerbung2.php"><input type="button" value="<<" name="ZURUECK"></a><a title="Weiter"><input type="submit" value=">>" name="WEITER"></a></td>
    </tr>
    <tr height="15">
    <td width="40"><a

    href="bewerbung1.php">Seite1</a></td>
    [/PHP]

    Wenn ich nun von Seite 3 aus per href zurück auf Seite 1 gehe funzt das.Der verlinkte Button ist aber doch theoretisch auch nichts anderes? Es werden dann zwar nicht die DAten von Seite 2 gespeichert, da kein Submit-Button aber die von Seite 1 sollten doch noch da sein. Das ist aber nicht der Fall.

  2. Wenn Du nun mit Deinem "href Link" auf Seite 1 zurückgehst stehen Die Daten drin.

    Das tun sie eben nicht, die stehen nur drin, weil die Daten so oder so von einer auf die nächste oder zurück übermittelt werden, das hat aber ja nichts mit den Sessions zu tun sondern einfach damit dass die Variablen per method post übermittelt werden.

    Oder seh ich das falsch?

    Das die Daten von Seite 2 nicht gespeichert werden ist klar.

    Um das zu beheben reicht das aus, den Button für zurück und den für vor mit einer id zu versehen und dann im formular einzubauen

    <form name="Formular" action="<?if (id=vor) echo seite3.php; else echo seite1.php;?>" method="post" enctype="multipart/form-data" onSubmit="return chkFormular()">

  3. Dank dir erstmal, Ich hatte dann doch noch so ein oder mehrere Fehler, die ich nun behoben habe dank eurer Hilfe. Ich glaub nun hab ich sogar die ganze Session-Sache kapiert.

    Das einzige Problem ist der von dir schon angesprochene "Zurück"-Button.

    Sobald ich den drücke geht das mit der Session nicht mehr.BZW. die Daten werden dann nicht mehr in die Textfelder eingelesen.

    Wie kann ich das Problem beseitigen bzw. mit welcher Methode funktioniert das Ganze?

    Um es nochmals zu erklären.

    Wenn ich mein Formular von Seite 1 bis 6 durcharbeite und am ENde dann wieder per URL auf Seite 1 gehe sind alle Daten in meinem Formular(Seite 1 bis 6 ) eingetragen. Gehe ich aber von Seite 6 auf Seite 5 und dann auf 4 usw. mit meinem Button für Zurück werden die DAten nicht in die Felder eingelesen.

    Button:

    <a title="Zurück" href="bewerbung1.php"><input type="button" value="<<" name="ZURUECK"></a>

    Weiss einer wieso dass so ist?Wird da eine neue Session gestartet?

    Vielen Dank für Antworten

  4. Seite 2:


    session_start();

    //Seite 1
    if ($_REQUEST["STELLE"] != "") {
    $_SESSION["S_STELLE"] = $_REQUEST["STELLE"];
    }
    else {
    $_SESSION["S_STELLE"] = "";
    }
    if ($_REQUEST["STANDORT"] != "") {
    $_SESSION["S_STANDORT"] = $_REQUEST["STANDORT"];
    }
    else {
    $_SESSION["S_STANDORT"] = "";
    }

    if ($_REQUEST["BART"] == "f" OR $_REQUEST["BART"] == "a" OR $_REQUEST["BART"] == "i") {
    $_SESSION["S_BART"] = $_REQUEST["BART"];
    }

    ?>
    <html>
    <head>
    <title>Onlinebewerbung</title>
    <link rel="stylesheet" href="../../shared/styles.css" type="text/css" />
    <script language="JavaScript">

    function chkFormular()
    {
    if ( document.Formular.ANREDE[0].checked == false && document.Formular.ANREDE[1].checked == false)
    {alert("Bitte wählen Sie eine Anrede aus!");
    //document.Formular.Anrede.focus();
    return false;
    }
    if(document.Formular.NAME.value == "")
    {
    alert("Bitte geben Sie Ihren Namen ein!");
    document.Formular.NAME.focus();
    return false;
    }
    if(document.Formular.VORNAME.value == "")
    {
    alert("Bitte geben Sie Ihren Vornamen ein!");
    document.Formular.VORNAME.focus();
    return false;
    }
    if(document.Formular.GEBURTSDATUM.value == "")
    {
    alert("Bitte geben Sie Ihr Geburtsdatum ein!");
    document.Formular.GEBURTSDATUM.focus();
    return false;
    }
    if(document.Formular.STAATSANGEHOERIGKEIT.value == "")
    {
    alert("Bitte geben sie Ihre Staatsangehörigkeit an!");
    document.Formular.STAATSANGEHOERIGKEIT.focus();
    return false;
    }
    if(document.Formular.STRASSE.value == "")
    {
    alert("Bitte geben Sie Strasse und Hausnummer an!");
    document.Formular.STRASSE.focus();
    return false;
    }
    if(document.Formular.PLZORT.value == "")
    {
    alert("Bitte geben Sie Postleitzahl und Ort an!");
    document.Formular.PLZORT.focus();
    return false;
    }
    if(document.Formular.LAND.value == "")
    {
    alert("Bitte geben Sie Ihr Herkunftsland an!");
    document.Formular.LAND.focus();
    return false;
    }
    if(document.Formular.TELEFON.value == "")
    {
    alert("Bitte geben Sie Ihre Telefonnummer an!");
    document.Formular.TELEFON.focus();
    return false;
    }
    }
    </script>
    </head>

    <body>


    <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
    <tr>
    <td>

    <!--innen-->
    <table cellpadding="0" cellspacing="0" border="0" width="980" height="517" align="center">
    <tr>
    <td>
    <!--innen-->
    <table cellpadding="0" cellspacing="0" border="0" class="tab_navi" width="980">
    <tr>
    <td width="" height="30" valign="top">
    <div class="abstand">

    <a href='../../index.php'>Onlinebewerbung</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../news/news.php'>News</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <!--<a href='../entwicklung/entwicklung.php'>Entwicklung</a>
    <span><img src="../../images/trenn_linie.gif"></span>-->
    <a href='../disposition/disposition.php'>Disposition</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../partner_werden/partner_werden.php'>Partner werden</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../kontakt/kontakt_geschaeftsfuehrung.php'>Kontakt</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../karriere/karriere.php'class='aktiv'>Karriere</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../impressum/impressum_fuerth.php'>Impressum</a>
    </div> </td>
    </tr>

    </table>
    <table cellpadding="0" cellspacing="0" border="0" class="tab_mitte">
    <tr>

    <td width="670" height="165">
    <img src="../../images/karriere.jpg" width="670" height="165"></td>

    <td width="310" height="165" valign="middle" align="center">
    <img src="../../images/logo.gif"></td>
    </tr>

    </table>

    <table cellpadding="0" cellspacing="0" border="0" class="tab_unten">
    <tr>
    <td colspan="3" width="980" height="65" valign="bottom"> <div class="aktiv_unter_navi">Onlinebewerbung
    </div>
    </tr>
    <tr>
    <td colspan="3" width="980" height="1" class="linie_h">
    <img src="../../px.gif" width="1" height="3"></td>
    </tr>
    <tr>
    <td width="580" height="14"></td>
    <td width="1" height="14"></td>
    </tr>
    <tr>
    <td width="580" height="240" align="center">

    <!--DA GEHT DIE INNERSTE TABELLE LOS-->

    <table border="0" cellpadding="0" cellspacing="0" width="980" height="240">

    <!--Formular zum Ausfüllen der Bewerbung-->

    <form name="Formular" action="bewerbung3.php" method="post" enctype="multipart/form-data" onSubmit="return chkFormular()">
    <tr height="30">
    <td width="40"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt; font-weight: 700">Persönliche Daten</td>
    <td width="195"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt; font-weight: 700">Adresse</td>
    <td width="195"></td>
    <td width="1" rowspan="9" height="240" class="linie_v"><img src="images/px.gif" width="1" height="1"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="15">
    <td width="40"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Anrede: *</font></td>
    <td width="195"><input type="radio" name="ANREDE" value="w" <? if ($_SESSION['S_ANREDE'] == 'w') echo 'checked'; ?>><font face="Arial" style="font-size: 8pt">Frau</font>

    <input type="radio" name="ANREDE" value="m" <? if ($_SESSION['S_ANREDE'] == 'm') echo 'checked'; ?>></font><font face="Arial" style="font-size: 8pt">Herr</font></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Titel:</font></td>
    <td width="195"><input type="text" name="TITEL" size="20" value="<?print $_SESSION["S_TITEL"];?>"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Strasse /Nr.: *</font></td>
    <td width="195"><input type="text" name="STRASSE" size="20" value="<?print $_SESSION["S_STRASSE"];?>"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Name: *</font></td>
    <td width="195"><input type="text" name="NAME" size="20" value="<?print $_SESSION["S_NAME"];?>"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">PLZ / Ort: *</font></td>
    <td width="195"><input type="text" name="PLZORT" size="20" value="<?print $_SESSION["S_PLZORT"];?>"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Vorname: *</font></td>
    <td width="195"><input type="text" name="VORNAME" size="20" value="<?print $_SESSION["S_VORNAME"];?>"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Land: *</font></td>
    <td width="195"><input type="text" name="LAND" size="20" value="<?print $_SESSION["S_LAND"];?>"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Geburtsdatum: *</font></td>
    <td width="195"><input type="text" name="GEBURTSDATUM" size="10" value="<?print $_SESSION["S_GEBURTSDATUM"];?>"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Telefon: *</font></td>
    <td width="195"><input type="text" name="TELEFON" size="20" value="<?print $_SESSION["S_TELEFON"];?>"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">Staatsangehörigkeit: *</font></td>
    <td width="195"><input type="text" name="STAATSANGEHOERIGKEIT" size="20" value="<?print $_SESSION["S_STAATSANGEHOERIGKEIT"];?>"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt">E-Mail:</font></td>
    <td width="195"><input type="text" name="EMAIL" size="20" value="<?print $_SESSION["S_EMAIL"];?>"></td>
    <td width="39"></td>
    <td width="270"><a title="Zurück" href="bewerbung1.php"><input type="button" value="<<" name="ZURUECK"></a><a title="Weiter"><input type="submit" value=">>" name="WEITER"></a></td>
    </tr>
    <tr height="15">
    <td width="40"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    </table>
    </form>


    <!--Formular zum Ausfüllen der Bewerbung-->


    </tr>
    </table></td>
    </tr>
    </table>


    <!--innen-->
    </td>
    </tr>
    </table>
    <!--innnen fertig-->

    </td>
    </tr>
    </table>

    </body>
    </html>
    [/PHP]

  5. Ok ich schreib mal von den zwei ersten Seiten den Code komplett rein aber durch die dummen Tabellen schaut der etwas wirr aus.

    Seite 1:


    <?
    session_start();

    ?>
    <html>
    <head>
    <title>Onlinebewerbung</title>
    <link rel="stylesheet" href="../../shared/styles.css" type="text/css" />
    <script language="JavaScript">

    function chkFormular()
    {
    if(document.Formular.STELLE.value == "")
    {
    alert("Bitte geben Sie die Stelle an, für die Sie sich bewerben wollen!");
    document.Formular.STELLE.focus();
    return false;
    }
    if(document.Formular.STANDORT.value == "")
    {
    alert("Bitte geben Sie den Standort an, für den Sie sich bewerben wollen!");
    document.Formular.STANDORT.focus();
    return false;
    }
    if ( document.Formular.BART[0].checked == false && document.Formular.BART[1].checked == false && document.Formular.BART[2].checked == false)
    {alert("Bitte wählen Sie aus, ob es sich um welche Art der Bewerbung es sich handlelt!");
    //document.Formular.BART.focus();
    return false;
    }
    }

    </script>
    </head>

    <body>


    <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
    <tr>
    <td>

    <!--innen-->
    <table cellpadding="0" cellspacing="0" border="0" width="980" height="517" align="center">
    <tr>
    <td>
    <!--innen-->
    <table cellpadding="0" cellspacing="0" border="0" class="tab_navi" width="980">
    <tr>
    <td width="" height="30" valign="top">
    <div class="abstand">

    <a href='../../index.php'>Onlinebewerbung</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../news/news.php'>News</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <!--<a href='../entwicklung/entwicklung.php'>Entwicklung</a>
    <span><img src="../../images/trenn_linie.gif"></span>-->
    <a href='../disposition/disposition.php'>Disposition</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../partner_werden/partner_werden.php'>Partner werden</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../kontakt/kontakt_geschaeftsfuehrung.php'>Kontakt</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../karriere/karriere.php'class='aktiv'>Karriere</a>
    <span><img src="../../images/trenn_linie.gif"></span>
    <a href='../impressum/impressum_fuerth.php'>Impressum</a>
    </div> </td>
    </tr>

    </table>
    <table cellpadding="0" cellspacing="0" border="0" class="tab_mitte">
    <tr>

    <td width="670" height="165">
    <img src="../../images/karriere.jpg" width="670" height="165"></td>

    <td width="310" height="165" valign="middle" align="center">
    <img src="../../images/logo.gif"></td>
    </tr>

    </table>

    <table cellpadding="0" cellspacing="0" border="0" class="tab_unten">
    <tr>
    <td colspan="3" width="980" height="65" valign="bottom"> <div class="aktiv_unter_navi">Onlinebewerbung
    </div>
    </tr>
    <tr>
    <td colspan="3" width="980" height="1" class="linie_h">
    <img src="../../px.gif" width="1" height="3"></td>
    </tr>
    <tr>
    <td width="580" height="14"></td>
    <td width="1" height="14"></td>
    </tr>
    <tr>
    <td width="580" height="240" align="center">

    <!--DA GEHT DIE INNERSTE TABELLE LOS-->

    <table border="0" cellpadding="0" cellspacing="0" width="980" height="240">

    <!--Formular zum Ausfüllen der Bewerbung-->

    <form name="Formular" action="bewerbung2.php" method="post" enctype="multipart/form-data" onSubmit="return chkFormular()">
    <tr height="30">
    <td width="40"></td>
    <th colspan="4" align="left">
    <font face="Arial" style="font-size: 8pt; font-weight: 400">Nehmen Sie sich einen Moment Zeit und füllen Sie unser Bewerbungsformular aus.</font></th>
    <td width="1" rowspan="8" height="240" class="linie_v"><img src="images/px.gif" width="1" height="1"></td>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <th colspan="4" align="left">
    <font face="Arial" style="font-size: 8pt; font-weight: 400">Mit * gekennzeichnete Felder müssen ausgefüllt werden.</font></th>
    <td width="39"></td>
    <td width="270"></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="39"></td>
    <td width="270"> </td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt; font-weight: 400">Stelle: *</td>
    <td width="195"><input type="text" name="STELLE" size="20" value="<?print $_SESSION["S_STELLE"];?>"></td>
    <td width="120"><font face="Arial" style="font-size: 8pt; font-weight: 400">Standort: *</td>
    <td width="195"><input type="text" name="STANDORT" size="20" value="<?print $_SESSION["S_STANDORT"];?>"></td>
    <td width="39"></td>
    <td width="270"> </td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td colspan="4"><font face="Arial" style="font-size: 8pt; font-weight: 400">Bitte angeben: *             
    <input type="radio" value="f" name="BART" <? if ($_SESSION['S_BART'] == 'f') echo 'checked'; ?>>Festanstellung  
    <input type="radio" name="BART" value="a" <? if ($_SESSION['S_BART'] == 'a') echo 'checked'; ?>>Ausbildungsplatz  <input type="radio" name="BART" value="i" <? if ($_SESSION['S_BART'] == 'i') echo 'checked'; ?>>Initiativbewerbung</font></td>
    <td width="39"></td>
    <td width="270"> </td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="39"></td>
    <td width="270"> </td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <th colspan="4" align="left">
    <font face="Arial" style="font-size: 8pt; font-weight: 400">Ihre Daten werden von uns vertraulich behandelt und nicht an Dritte weitergegeben.</font></th>
    <td width="39"></td>
    <td width="270"><a title="Weiter"><input type="submit" value=">>" name="WEITER"></a></td>
    </tr>
    <tr height="30">
    <td width="40"></td>
    <td width="120"></td>

    <td width="195"></td>
    <td width="120"></td>
    <td width="195"></td>
    <td width="39"></td>
    <td width="270"> </td>
    </tr>
    </table>
    </form>


    <!--Formular zum Ausfüllen der Bewerbung-->


    </tr>
    </table></td>
    </tr>
    </table>


    <!--innen-->
    </td>
    </tr>
    </table>
    <!--innnen fertig-->

    </td>
    </tr>
    </table>

    </body>
    </html>
    [/PHP]

  6. Ganz blöde Frage.

    Die Daten im momentanen Code sind auf seite1.php.

    Ich liege doch richtig dass auch dort die Session mit den ganzen Variablen dazu im Code sein muss.

    ich muss aber auf seite2.php dann den code, den wir besprechen nicht nochmal bringen sondern nur ganz am anfang session_start().

    Nur um nicht da ein Verständnisfehler zu haben.

    Ich test jetzt nochmal mit deinem Request ob das was ändert.

  7. aber ich :D

    Jetz übernimmt er gar keine Daten mehr ins Formular. Das ist doch echt zum davonlaufen.

    Habs nun so gemacht und das funzt noch weniger:



    session_start();

    //Seite 1
    if ( $HTTP_POST_VARS["STELLE"] != "" )
    {
    $_SESSION["S_STELLE"] = $HTTP_POST_VARS["STELLE"];
    }
    else
    {
    $_SESSION["S_STELLE"] = "";
    }

    if ( $HTTP_POST_VARS["STANDORT"] != "" )
    {
    $_SESSION["S_STANDORT"] = $HTTP_POST_VARS["STANDORT"];
    }
    else
    {
    $_SESSION["S_STANDORT"] = "";
    }

    if ( $HTTP_POST_VARS["BART"] == "f" )
    {
    $_SESSION["S_BART"] = $HTTP_POST_VARS["BART"];
    }
    if ( $HTTP_POST_VARS["BART"] == "a" )
    {
    $_SESSION["S_BART"] = $HTTP_POST_VARS["BART"];
    }
    if ( $HTTP_POST_VARS["BART"] == "i" )
    {
    $_SESSION["S_BART"] = $HTTP_POST_VARS["BART"];
    }


    [/PHP]

  8. Momentan hab ich die ganzen anderen Variablen mal rausgenommen, d.h. es sieht so aus:


    if ( $HTTP_POST_VARS["AUSBILDUNG"] != "" )
    {
    // $A_AUSBILDUNG = $HTTP_POST_VARS["AUSBILDUNG"];
    $_SESSION["S_AUSBILDUNG"] = $HTTP_POST_VARS["AUSBILDUNG"];
    }
    elseif ( $HTTP_POST_VARS["AUSBILDUNG"] == "" )
    {
    // $A_AUSBILDUNG == "";
    $_SESSION["S_AUSBILDUNG"] == "";
    }
    [/PHP]

    Nach wie vor kein Problem wenn ich aus "test" "test2" mache aber halt wenn ich das Feld leer lasse wird nichts aktualisiert

    [PHP]<td width="195"><input type="text" name="AUSBILDUNG" value="<?print $_SESSION["S_AUSBILDUNG"];?>" size="20"></td>

  9. OK das mit den vielen Variablen einmal aussen vor.

    die sessionvariable wird ja aktualisiert, wenn ich z.B. ins textfeld das wort "test" schreibe dann steht dort bis ich die Session zerstöre "test". sobald ich das wort "test" mit "test2" ersetze steht dort auch ewig "test2" drin. Nur sobald ich das feld komplett lösche und leerlassen will steht immer noch das wort "test" oder "test2" drin, je nachdem welches ich dort als letzte drin hatte.

  10. Da muss ich dich an die Erklärung von jemanden verweisen, ich selbst habe das noch nicht hundertprozentig verstanden aber nachdem es auf diese Art und Weise ging übernommen.

    Zitat:


    session_start();

    // Sessiondaten wiederherstellen.

    $S_AUSBILDUNG= $_SESSION["S_AUSBILDUNG"];


    // Sessiondaten in (A)ktive Variable hinterlegen.

    $A_AUSBILDUNG= $S_AUSBILDUNG;

    // Prüfen auf Formulardaten. Sessionvariable neu-registrieren.

    if ( $HTTP_POST_VARS["AUSBILDUNG"] != "" ) {
    // Formulardaten in (A)ktive Variable hinterlegen.
    $A_AUSBILDUNG= $HTTP_POST_VARS["AUSBILDUNG"];
    $_SESSION["S_AUSBILDUNG"] = $HTTP_POST_VARS["AUSBILDUNG"];
    }
    [/PHP]

  11. Inzwischen weiss ich, dass es an den Formularfeldern nicht liegt, sondern an der Session bzw. einer Bedingung.

    Hier kommt auch schon der Code:


    $S_AUSBILDUNG = $_SESSION["S_AUSBILDUNG"];

    $A_AUSBILDUNG = $S_AUSBILDUNG;

    if ( $HTTP_POST_VARS["AUSBILDUNG"] != "" )
    {
    $A_AUSBILDUNG = $HTTP_POST_VARS["AUSBILDUNG"];
    $_SESSION["S_AUSBILDUNG"] = $HTTP_POST_VARS["AUSBILDUNG"];
    }
    [/PHP]

    So werden die Daten auch wieder in den Feldern angezeigt, aber wenn ich nun das Feld Ausbildung wieder lösche stehen die Daten immer noch drin :(

    Und mit folgendem Code ist es dasselbe:

    [PHP]
    if ( $HTTP_POST_VARS["AUSBILDUNG"] != "" )
    {
    $A_AUSBILDUNG = $HTTP_POST_VARS["AUSBILDUNG"];
    $_SESSION["S_AUSBILDUNG"] = $HTTP_POST_VARS["AUSBILDUNG"];
    }
    elseif ( $HTTP_POST_VARS["AUSBILDUNG"] == "" )
    {
    $A_AUSBILDUNG = $HTTP_POST_VARS["AUSBILDUNG"];
    $_SESSION["S_AUSBILDUNG"] = $HTTP_POST_VARS["AUSBILDUNG"];
    }

    Wenn ich nun das Feld Ausbildung lösche dann auf Submit gehe habe ich dennoch die Alten Daten in den Variablen $A_AUSBILDUNG und $_SESSION["S_AUSBILDUNG"]

  12. Also ich blick es echt nicht. Ich weiss, dass die Daten aus den entsprechenden Feldern in der Variable stehen, weil sie am Ende des Formulars auch per Mail übermittelt werden. Ich kann sie also in der E-Mail sehen.

    In meinem Formular werden sie beim zurückgehen dennoch nicht in die Felder eingetragen.

    Momentan schaut mein Code so aus und eigentlich müsste der doch funzen:

    Checkbox:

    <td width="195"><input type="checkbox" name="KAUSBILDUNG"  id="blaaa" value="<? if ($A_KAUSBILDUNG == "1") echo "checked"; ?>"</td>

    Textfeld:

    <td width="195"><input type="text" name="AUSBILDUNG" value="<? if ($A_KAUSBILDUNG != "1") echo "$A_AUSBILDUNG"; ?>" size="20"></td>

  13. Moin Moin,

    habe gerade entdeckt, dass in meinem Formular einige Daten nur per "post" übergeben werden und irgendein Fehler mit der Session da sein müsste.

    Ich habe ein Textfeld "Ausbildung" und eine Checkbox für "Keine Ausbildung"

    Es soll aber nur entweder das Feld "Ausbildung" oder die Checkbox "Keine Ausbildung" aktiviert bzw. mit Daten versehen sein.

    Leider werden die Daten nicht in der Session gespeichert bzw. nicht mehr richtig im Feld eingelesen. Denn wenn ich die Sessionvariablen ausgebe dann sind dort schon Werte vorhanden. Ich habe auch kein session_start() vergessen :) Alle anderen Textfelder werden einwandfrei bearbeitet.

    Code der Session:


    $S_AUSBILDUNG = $_SESSION["S_AUSBILDUNG"];
    $S_KAUSBILDUNG = $_SESSION["S_KAUSBILDUNG"];

    $A_AUSBILDUNG = $S_AUSBILDUNG;
    $A_KAUSBILDUNG = $S_KAUSBILDUNG;



    if ( $HTTP_POST_VARS["AUSBILDUNG"] != "" )
    {
    $A_AUSBILDUNG = $HTTP_POST_VARS["AUSBILDUNG"];
    $_SESSION["S_AUSBILDUNG"] = $HTTP_POST_VARS["AUSBILDUNG"];
    }

    if ( $HTTP_POST_VARS["KAUSBILDUNG"] != "" )
    {
    $A_KAUSBILDUNG = $HTTP_POST_VARS["KAUSBILDUNG"];
    $_SESSION["S_KAUSBILDUNG"] = $HTTP_POST_VARS["KAUSBILDUNG"];
    }
    [/PHP]

    Code für das Formularfeld(er):

    [PHP]
    <td width="195"><input type="text" name="AUSBILDUNG" value="<? if (!$_SESSION['S_KAUSBILDUNG']) echo $A_AUSBILDUNG; ?>" size="20"></td>

    <td width="195"><input type="checkbox" name="KAUSBILDUNG" id="blaaa" value="<? if ($_SESSION['S_KAUSBILDUNG']) echo 'checked'; ?>"</td>

    Ich grüble nun schon wieder ziemlich lang und habe auch schon so einiges probiert, konnte den Fehler aber nicht beheben oder finden.

    Vielen Dank schonmal.

    Gruss Sebi

  14. OK hab den Fehler selber gefunden, stehe aber nun vor dem Problem, dass hinter dem Dateinamen ein $ angefügt ist.

    Also z.B.:

    Testdatei.doc$

    Quellcode für einen Dateianhang:


    $MailBody .= "Content-Type: application/pdf; name=" . $_FILES['datei3']['name'] . "";
    $MailBody .= "$EOL";
    $MailBody .= "Content-Transfer-Encoding: base64";
    $MailBody .= "$EOL";
    $MailBody .= "Content-Disposition: attachement; filename=" . $_FILES['datei3']['name'] . "";
    $MailBody .= "$$EOL$EOL";
    $Dateiinhalt = fread(fopen($datei3, "rb"), filesize($datei3));
    $MailBody .= chunk_split(base64_encode($Dateiinhalt));

    [/PHP]

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...