Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Formulare in PHP

Empfohlene Antworten

Veröffentlicht

Morgen,

ich habe ein Problem mit Formularfeldern. Bei mir werden Variablen nicht richtig übergeben. Die textarea wird übergeben aber die beiden input felder "vorname/nachname" werden nicht übergeben. Warum???

Hier der Quellcode...



<?php

if($sele=="Suche")

{

        echo "Daten fuer Suche eingetragen...";

        include "func/glvar.php";       

        include "func/connect.php";

        mysql_select_db($daba);

        mysql_query("INSERT INTO tbl_suche(vname, name, suche)VALUES('$nachname', '$vorname', '$text');");  

        mysql_close();

        $button=="";

}

elseif($sele=="Biete")

{

        echo "Daten fuer Biete eingetragen...";

        include "func/glvar.php";

        include "func/connect.php";

        mysql_select_db($daba);

        mysql_query("INSERT INTO tbl_biete(vname, name, biete)VALUES('$nachname', '$vorname', '$text');");

        mysql_close();

        $button=="";

}


else

{

        include "func/glvar.php";


        echo "

        <h1>Suche und Biete</h1>

        <p>

        <form method=\"post\" action=\"http://$webserver/text/eingabe.php\">

        Bitte Vor- und Nachname eingeben:<br>  

        <input type=\"text\" name=\"vname\" value=\"vorname\"><br>

        <input type=\"text\" name=\"nname\" value=\"nachname\"><br>

        <textarea name=\"text\" value=\"text\"></textarea><br>

        ";


        if($sele=="Biete")

        {

                $sel="tbl_biete";

        }

        else

        {

                $sel="tbl_suche";

        }


        $selc=explode("tbl_", $sel);


        echo $sel." wurde ausgewählt";

        echo $selc[1];

        echo "

        <input type=\"submit\" name=\"sele\" value=\"Suche\">

        <input type=\"submit\" name=\"sele\" value=\"Biete\">

        </form>

        </p>";

}

?>

In den Headern glvar.php befinden sich die Variablen und connect spricht für sich :-)...

Gruß

debitux

versuchs mal mit den Variablen $vname und $nname...

The HotkeyM

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.