Formulier automatisch invullen na 1 keuze

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Senior, Medior and Junior SAP HANA Developer

Vacature details Vakgebied: Software/IT Opleiding: Medior Werklocatie: Veldhoven Vacature ID: 12696 Introductie Our client is the world's leading provider of lithography systems for the semiconductor industry, manufacturing complex machines that are critical to the production of integrated circuits or chips. Our purpose is “unlocking the potential of people and society by pushing technology to new limits”. We do this guided by the principles “Challenge”, “Collaborate” and “Care”. Wat verwachten we van jou? SAP Certified Application Associate - SAP HANA Cloud Modeling (training and/or certification) Bachelor degree or higher Excellent understanding of SAP HANA (2.0 / Cloud), Data Modelling and writing

Bekijk vacature »

Erik waarom

Erik waarom

31/05/2006 16:32:00
Quote Anchor link
Kan iemand me op weg helpen met het maken van een formulier die zichzelf invult met gegevens uit een database na je in een veld een keuze hebt gemaakt?
 
PHP hulp

PHP hulp

05/05/2024 17:36:20
 
Willem Jan Z

Willem Jan Z

31/05/2006 16:40:00
Quote Anchor link
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
include 'connect.inc.php';
echo '<form method="post" action="actie.php">';
$sql2 = "SELECT id, titel FROM tabel;";
        $res2 = mysql_query($sql2) or die(mysql_error());
        
        if(mysql_num_rows($res2) > 0)
        {

            while($row2 = mysql_fetch_assoc($res2))
            {

    
            echo '<select name="id">
            <option value="'
.$row2['id'].'"><input type="submit" value="Sla op" />
            </form>'
;
        }


    if($_SERVER['REQUEST_METHOD'] == "POST")
    {

        $id = is_numeric($_POST['id']) ? $_POST['id'] : '0';
    
        $sql = "SELECT titel, bericht FROM tabel WHERE id = ".$id.";";
        $res = mysql_query($sql) or die(mysql_error());
    
        if(mysql_num_rows($res) > 0)
        {

            $row = mysql_fetch_assoc($res);
            echo '<form method="post" action="actie.php">
            Titel:<br /><input type="text" name="titel" value="'
.$row['titel'].'" /><br />
            Bericht:<br /><textarea name="titel" rows="8" cols="25">'
.$row['titel'].'</textarea><br />
            <input type="submit" value="Sla op" />
            </form>'
;
        }

        else
        {
        echo 'Het opgegeven ID bestaat niet!';
        }
    }

?>


Edit
Ik snapte het verkeerd, geef me een momentje :)

Edit2
De nieuwe versie, dit is wel met een refresh, en niet getest.
Gewijzigd op 01/01/1970 01:00:00 door Willem Jan Z
 
Erik waarom

Erik waarom

31/05/2006 21:23:00
Quote Anchor link
Danku danku danku, kan hem nu niet proberen:) moest spontaan weg. Zal het morgen vroeg doen.

Heel erg bedankt!!!!!!!! laat morgen of straks ff weten of het goed werkt.
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.