Wijziging maken in database

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Patrick Vaarkamp

Patrick Vaarkamp

22/03/2009 19:58:00
Quote Anchor link
Hallo,

Ik zoek iemand die mij wil helpen met het maken van een script waarmee ik wijzigingen kan maken in een database. Heb zelf al wat geprobeerd maar het lukt mij niet.

Onderstaand script heb ik niet zelf gemaakt maar het is een omgebouwd gastenboek eigelijk, haha.

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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?php
ob_start();
include "config.php";
?>


<head>
<title>Bestellingen</title>
<link href="../style.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUpbest(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=830,height=200');");
}
// End -->
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUpEmail(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=510,height=390');");
}
// End -->
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUpAankoop(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=615,height=430');");
}
// End -->
</script>
</head>
<body>
<center>
<a href="index.php"><b>Bestellingen</b></a> - <a href="besteld.php">Besteld</a> - <a href="winst.php">Winst</a>
</center>
<hr><br>
<center>
<?php
if(isset($_GET['verwijder'])){
    $delete = "DELETE FROM bestellingen WHERE id='".$_GET['verwijder']."'";
    if(mysql_query($delete)){
    ?>


<td colspan="2" align="center"><font size="4"><b>Bestellingen<br><br></b></font></td>
<table border="0" cellpadding="0" cellspacing="0" id="table24" width="353">
<tr>
<td width="353" bgcolor="#808080" height="15" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center><font size="2"><b>Verwijderd</b></font></td>
</tr>
<tr>
<td width="353" bgcolor="#C0C0C0" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center>
<font face=Arial color=#000000 size=2>
De bestelling is verwijderd.<br /><br /><a href="index.php?controleer=ja">Klik hier om terug te gaan</a>
</td>
</tr>
</table>
        <?
        exit();
    }

    else{
    ?>

<table border="0" cellpadding="0" cellspacing="0" id="table24" width="353">
<tr>
<td width="353" bgcolor="#808080" height="15" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center><font size="2"><b>Niet Verwijderd</b></font></td>
</tr>
<tr>
<td width="353" bgcolor="#C0C0C0" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center>
<font face=Arial color=#FFFFFF size=2>
De bestelling is niet verwijderd.<br /><br /><a href="index.php?controleer=ja">Klik hier om terug te gaan</a>
</td>
</tr>
</table>
        <?
        exit();
    }
}

// de admin controleren
if(isset($_GET['controleer'])and($_GET['controleer']=="ja")){
    if((isset($_POST['adminnaam']))and(isset($_POST['password']))){
        if(($_POST['adminnaam']!=$adminnaam)or($_POST['password']!=$adminwachtwoord)){
            ?>

<table border="0" cellpadding="0" cellspacing="0" id="table24" width="353">
<tr>
<td width="353" bgcolor="#808080" height="15" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center><font size="2"><b>Admin Loginfout</b></font></td>
</tr>
<tr>
<td width="353" bgcolor="#C0C0C0" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center>
<font face=Arial color=#FFFFFF size=2>
Je kon niet worden ingelogd omdat er een fout was in je naam of wachtwoord<br /><br /><a href="index.php">Klik hier om het nogmaals te proberen</a></td>
</tr>
</table>
            <?
            exit();
        }

        if(($_POST['adminnaam']==$adminnaam)and($_POST['password']==$adminwachtwoord)){
            setcookie("adminbestellingen",$adminnaam,"0","/");
            header("refresh:1");
        }
    }

    if(isset($_COOKIE['adminbestellingen'])){
        $aantal = mysql_num_rows(mysql_query("SELECT * FROM bestellingen"));
    if($aantal>0){
        $select = mysql_query("SELECT id, naamkoper, straathuisnr, postcodeplaats, datum, email, product1, product2, product3, aantal1, aantal2, aantal3, bedrag, bedrag1, bedrag2, bedrag3, totaalbedr, status, kleur, tracktrace, ip FROM bestellingen ORDER by id DESC");
        ?>

        <table width="300px" cellspacing="0">
            <tr>
                <td colspan="2" align="center"><font size="4"><b>Bestellingen</b></font><br><br>
                <a href="javascript:popUpbest('bestellingplaatsen.php')"><b>Bestelling toevoegen</b></a>
                <br>
                </td>
               </tr>
              <tr>
<? while($f=mysql_fetch_object($select)){?>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" id="schrijf" width="680" bordercolor="#000000">
<tr>
<td width="680" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center>
<table width="640" id="schrijf" style="border-collapse: collapse" border="1" bordercolor="#000000">
    <?=$error;?>
    <tr>
        <td width="200"><b><font size="2">Adres:</font></b></td>
        <td width="215"><b><font size="2">Product(en):</font></b></td>
        <td width="54"><b><font size="2">Aantal:</font></b></td>
        <td width="165"><b><font size="2">Status:</font></b></td>
    </tr>
    <tr>
        <td width="200"><?=$f->naamkoper;?><br><?=$f->straathuisnr;?><br><?=$f->postcodeplaats;?><br><br></td>
        <td width="215"><?=$f->product1;?><br><?=$f->product2;?><br><?=$f->product3;?><br><?=$f->tracktrace;?></td>
        <td width="54"><?=$f->aantal1;?><br><?=$f->aantal2;?><br><?=$f->aantal3;?><br><br></td>
        <td width="165"><?=$f->status;?><br><br>
        <font size="2"><b>Betaald:</b></font><br><?=$f->bedrag;?><br>
     </tr>
    <tr>
        <td><a style="text-decoration: none" href="javascript:popUpEmail('mail.php?naam=<?=$f->naamkoper;?>&straatnr=<?=$f->straathuisnr;?>&postcodeplaats=<?=$f->postcodeplaats;?>&email=<?=$f->email;?>&prod1=<?=$f->product1;?>&prod2=<?=$f->product2;?>&prod3=<?=$f->product3;?>&aantal1=<?=$f->aantal1;?>&aantal2=<?=$f->aantal2;?>&aantal3=<?=$f->aantal3;?>&bedrag1=<?=$f->bedrag1;?>&bedrag2=<?=$f->bedrag2;?>&bedrag3=<?=$f->bedrag3;?>&totaalbedr=<?=$f->totaalbedr;?>&tracktrace=<?=$f->tracktrace;?>')"><font size="2"><b>Email</b></font></a> -
        <a style="text-decoration: none" href="javascript:popUpAankoop('aankoopbewijs.php?naam=<?=$f->naamkoper;?>&straatnr=<?=$f->straathuisnr;?>&postcodeplaats=<?=$f->postcodeplaats;?>&email=<?=$f->email;?>&prod1=<?=$f->product1;?>&prod2=<?=$f->product2;?>&prod3=<?=$f->product3;?>&aantal1=<?=$f->aantal1;?>&aantal2=<?=$f->aantal2;?>&aantal3=<?=$f->aantal3;?>&bedrag1=<?=$f->bedrag1;?>&bedrag2=<?=$f->bedrag2;?>&bedrag3=<?=$f->bedrag3;?>&totaalbedr=<?=$f->totaalbedr;?>')"><font size="2"><b>Aankoopbewijs</b></font></a></td>
        <td bgcolor="<?=$f->kleur;?>">&nbsp;</td>
        <td>&nbsp;</td>
        <td><a href="<?=$_SERVER['PHP_SELF'];?>?edit=<?=$f->id;?>">wijzig</a> - <a href="<?=$_SERVER['PHP_SELF'];?>?delete=<?=$f->id;?>">x</a></td>
    </tr>
   </td>
  </tr>
 </td>
</tr>
</table>
<?php }?>
</table>

<?php
        }
        else{?>

        
<td colspan="2" align="center"><font size="4"><b>Bestellingen</b></font></td><br><br>
<a href="javascript:popUpbest('bestellingplaatsen.php')"><b>Bestelling toevoegen</b></a>
<br><br>
Er zijn geen bestellingen

<?php
        }
        exit();
    }
}

if(isset($_GET['delete'])){
    if(!isset($_COOKIE['adminbestellingen'])){
        echo"Je moet wel ingelogd zijn";
        exit();
    }

    if(isset($_COOKIE['adminbestellingen'])){
        $haalop=mysql_fetch_object(mysql_query("SELECT naamkoper, straathuisnr, postcodeplaats, datum, email, product1, product2, product3, aantal1, aantal2, aantal3, bedrag, bedrag1, bedrag2, bedrag3, totaalbedr, status, kleur, tracktrace, ip FROM bestellingen"));?>

        <table width="300px" cellspacing="0">
            <tr>

<td colspan="2" align="center"><font size="4"><b>Bestellingen</b></font><br><br></td>
<table border="0" cellpadding="0" cellspacing="0" id="table24" width="353">
<tr>
<td width="353" bgcolor="#808080" height="15" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center><font size="2"><b>Melding</b></font></td>
</tr>
<tr>
<td width="353" bgcolor="#C0C0C0" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center>
<font face=Arial color=#000000 size=2>
Weet u zeker dat u deze bestelling wilt verwijderen?<br><br>
<table width="300px" cellspacing="0">
<tr>
<td width="50%" align="center"><a href="<?=$_SERVER['PHP_SELF'];?>?verwijder=<?=$_GET['delete'];?>"><b>Ja</b></a></td>
<td align="center"><a href="<?=$_SERVER['PHP_SELF'];?>?controleer=ja"><b>Nee</b></a></td>
</td>
</tr>
</table>

        <?
        exit();
    }
}

if(isset($_COOKIE['adminbestellingen'])){
    header("location:index.php?controleer=ja");
}

?>


<!-- Het loginscherm -->
<form name="adminlogin" action="<?=$_SERVER['PHP_SELF'];?>?controleer=ja" method="post">
<center>
<font size="2"><b>Admin Login</b></font><br><br></td>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-left-width: 0" bordercolor="#111111" width="100%" id="table1">
<tr>
<table width="240" cellspacing="0">
<tr>
</tr>
<tr>
    <td width="88">Inlognaam:</td>
    <td width="148"><input type="text" name="adminnaam" /></td>
</tr>
<tr>
    <td>Wachtwoord:</td>
    <td width="148"><input type="password" name="password" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><input type="submit" value="Inloggen">
</form>
</td>
</tr>
</table>
</center>
</body>


Het is een systeem om bestellingen bij te houden :) heb een best wel goed lopend handeltje, vandaar.

Hoop dat iemand me kan helpen.
 
PHP hulp

PHP hulp

18/04/2024 19:53:48
 
Jesper Diovo

Jesper Diovo

22/03/2009 20:06:00
Quote Anchor link
Ik zie ook nergens een UPDATE-query die wijzigingen aanbrengt. Dus ik snap je vraagstelling eigenlijk niet? Overigens schieten wij niet zoveel op met zoveel code. Pak er juist het stukje uit waar je je vraag over stelt en leg precies uit wat hij doet en hoe dat eigenlijk zou moeten.
 
Patrick Vaarkamp

Patrick Vaarkamp

22/03/2009 20:08:00
Quote Anchor link
Nee dit is het hele script. En er moet dus een UPDATE functie bij komen.

Maar laat ik het anders zeggen. Ik wil dus (het liefst) een kant en klaar script waarmee ik de volgende waardes uit een database kan updaten.

Database: bestelsysteem
Query: bestellingen

Waardes:
- id (hoeft niet geupdate te kunnen worden maar heb je natuurlijk wel nodig)
- naamkoper
- straathuisnr
- postcodeplaats
- email
- product1
- product2
- product3
- aantal1
- aantal2
- aantal3
- bedrag
- bedrag1
- bedrag2
- bedrag3
- totaalbedr
- status
- kleur
- tracktrace
Gewijzigd op 01/01/1970 01:00:00 door Patrick Vaarkamp
 
- SanThe -

- SanThe -

22/03/2009 20:42:00
Quote Anchor link
Lees eens wat tutorials door.

www.phptuts.nl
 
Tikkes C

Tikkes C

22/03/2009 20:46:00
Quote Anchor link
zelf in elkaar steken kost je niets, enkel wat tijd.

UPDATE bestellingen SET veld=nieuweWaarde WHERE condition=conditionCheck (AND condition2=condition2Check) enzovoort
 
Patrick Vaarkamp

Patrick Vaarkamp

22/03/2009 20:54:00
Quote Anchor link
SanThe schreef op 22.03.2009 20:42:
Lees eens wat tutorials door.

www.phptuts.nl


Dan kom ik uit bij http://www.phptuts.nl/view/41/9/ wat ik op deze site ook al was tegengekomen. Ik kom er alleen niks mee verder.

Ik wil eigelijk zo snel mogelijk een oplossing dus zoek een ervaren iemand die mij wil helpen.

Edit:

Ik ben al een stapje verder. Heb deze code en dat werkt.

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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
ob_start();
include "config.php";
?>


<?php
function mysql_update($tabel, $update, $where)
{

    $update2 = array();

    foreach($update as $key => $value)
    {

         $update2[] = $key."='".mysql_escape_string($value)."'";
    }


    $where2 = array();

    foreach($where as $key => $value)
    {

         $where2[] = $key."='".mysql_escape_string($value)."'";
    }


    $update = implode($update2, ', ');
    $where  = implode($where2, ' AND ');

    mysql_query("UPDATE ".$tabel." SET ".$update." WHERE ".$where) or die (mysql_error());

    return true;
}


$update = array();
$update['naamkoper'] = "$_POST[naamkoper]";
$update['straathuisnr'] = "$_POST[straathuisnr]";
$update['postcodeplaats'] = "$_POST[postcodeplaats]";
$update['email'] = "$_POST[email]";
$update['product1'] = "$_POST[product1]";
$update['product2'] = "$_POST[product2]";
$update['product3'] = "$_POST[product3]";
$update['aantal1'] = "$_POST[aantal1]";
$update['aantal2'] = "$_POST[aantal2]";
$update['aantal3'] = "$_POST[aantal3]";
$update['bedrag'] = "$_POST[bedrag]";
$update['bedrag1'] = "$_POST[bedrag1]";
$update['bedrag2'] = "$_POST[bedrag2]";
$update['bedrag3'] = "$_POST[bedrag3]";
$update['totaalbedr'] = "$_POST[totaalbedr]";
$update['status'] = "$_POST[status]";
$update['kleur'] = "$_POST[kleur]";
$update['tracktrace'] = "$_POST[tracktrace]";

$where = array();
$where['id'] = $_POST[id];

mysql_update("bestellingen", $update, $where);
?>


Weet niet of dat POST klopt hoor misschien moet het wel GET zijn? Ben nog beetje aan het experimenteren dus. Nou moet ik alleen nog alle waardes uit de database kunnen halen (ik laat alle velden automatisch invullen d.m.v. <input value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?=$f->naamkoper;?>
" type="text" name="naamkoper" size="30">) dan de dingen die aangepast moeten worden aanpassen, en daarna bovenstaand script aanroepen.

Maargoed, dat heb ik dus nog niet....
Gewijzigd op 01/01/1970 01:00:00 door Patrick Vaarkamp
 
Patrick Vaarkamp

Patrick Vaarkamp

23/03/2009 23:28:00
Quote Anchor link
Ik ben een stapje verder.

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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
ob_start();
include "config.php";
?>


<head>
<title>Bestellingen Bewerken</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<center>
<?
// de admin controleren
if(isset($_GET['controleer'])and($_GET['controleer']=="ja")){
    if((isset($_POST['adminnaam']))and(isset($_POST['password']))){
        if(($_POST['adminnaam']!=$adminnaam)or($_POST['password']!=$adminwachtwoord)){
            ?>

<table border="0" cellpadding="0" cellspacing="0" id="table24" width="353">
<tr>
<td width="353" bgcolor="#808080" height="15" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center><font size="2"><b>Admin Loginfout</b></font></td>
</tr>
<tr>
<td width="353" bgcolor="#C0C0C0" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt">
<center>
<font face=Arial color=#FFFFFF size=2>
Je kon niet worden ingelogd omdat er een fout was in je naam of wachtwoord<br /><br /><a href="index.php">Klik hier om het nogmaals te proberen</a></td>
</tr>
</table>
            <?
        }
        if(($_POST['adminnaam']==$adminnaam)and($_POST['password']==$adminwachtwoord)){
            setcookie("adminbestellingen",$adminnaam,"0","/");
            header("refresh:1");
        }
    }

    if(isset($_COOKIE['adminbestellingen'])){
        $aantal = mysql_num_rows(mysql_query("SELECT * FROM bestellingen"));
    if($aantal>0){
        $select = mysql_query("SELECT id, naamkoper, straathuisnr, postcodeplaats, datum, email, product1, product2, product3, aantal1, aantal2, aantal3, bedrag, bedrag1, bedrag2, bedrag3, totaalbedr, status, kleur, tracktrace, ip FROM bestellingen WHERE id=2 ;");
        ?>


<? while($f=mysql_fetch_object($select)){?>
</table>
<br>
<form name="schrijf" action="editt.php" method="post">
<input type="hidden" name="id" value="<?=$f->id;?>" />
<table border="0" cellpadding="0" cellspacing="0" id="schrijf" width="814" bordercolor="#000000">
<tr>
<td width="814" height="15" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt" bgcolor="#808080">
<center><font size="2"><b>Bestelling Aanpassen:</b></font></td>
</tr>
<tr>
<td width="814" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt" border="1" bordercolor="#000000">
<center>
<table width="814" id="schrijf" bgcolor="#C0C0C0" style="border-collapse: collapse" border="1" bordercolor="#000000">
    <?=$error;?>
    <tr>
        <td width="226"><font size="2"><b>Klantgegevens:</b></font></td>
        <td width="236"><font size="2"><b>Product(en):</b></font></td>
        <td width="58"><font size="2"><b>Aantal:</b></font></td>
        <td width="61"><font size="2"><b>Bedrag:</b></font></td>
        <td width="210"><font size="2"><b>Status/Bedrag:</b></font></td>
    </tr>
    <tr>
        <td width="226"><input value="<?=$f->naamkoper;?>" type="text" name="naamkoper" size="30"><br><input value="<?=$f->straathuisnr;?>" type="text" name="straathuisnr" size="30"><br><input value="<?=$f->postcodeplaats;?>" type="text" name="postcodeplaats" size="30"><br><br></td>
        <td width="236"><select name="product1" size="1"><option value="<?=$f->product1;?>"><?=$f->product1;?></option><?php include ("producten.txt"); ?></select><br>
        <select name="product2" size="1"><option value="<?=$f->product2;?>"><?=$f->product2;?></option><?php include ("producten.txt"); ?></select><br>
        <select name="product3" size="1"><option value="<?=$f->product3;?>"><?=$f->product3;?></option><?php include ("producten.txt"); ?></select><br><br></td>
        <td width="58"><select name="aantal1" size="1"><option value="<?=$f->aantal1;?>"><?=$f->aantal1;?></option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select><br>
        <select name="aantal2" size="1"><option value="<?=$f->aantal3;?>"><?=$f->aantal2;?></option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select><br><select name="aantal3" size="1"><option value="<?=$f->aantal3;?>"><?=$f->aantal3;?></option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select><br><br></td>
        <td width="61"><input type="text" name="bedrag1" size="4" value="<?=$f->bedrag1;?>"><br>
        <input type="text" name="bedrag2" size="4" value="<?=$f->bedrag2;?>"><br><input type="text" name="bedrag3" size="4" value="<?=$f->bedrag3;?>"><br><br></td>
        <td width="210"><select name="status" size="1"><option value="<?=$f->status;?>"><?=$f->status;?></option><option value="Besteld, wachten op betaling">Besteld, wachten op betaling</option><option value="Besteld, wachten op levering">Besteld, wachten op levering</option><option value="Binnen, versturen">Binnen, versturen</option><option value="Verstuurd">Verstuurd</option></select><br><br>
        <font size="2"><b>Betaald:</b></font><br>
        <input value="<?=$f->bedrag;?>" type="text" name="bedrag" size="20"><br>
     </tr>
    <tr>
        <td><font size="2"><b>Email:</b></font> <input value="<?=$f->email;?>" type="text" name="email" size="24"></td>
        <td><font size="2"><b>Track&Trace:</b></font> <input value="<?=$f->tracktrace;?>" type="text" name="tracktrace" size="18"></td>
        <td> </td>
        <td><input value="<?=$f->totaalbedr;?>" type="text" name="totaalbedr" size="4"></td>
        <td>
<select name="kleur" size="1">
<option value="#FFA500">Oranje</option>
<option value="#FF0000">Rood</option>
<option value="#00FF00">Groen</option>
</select></td>
    </tr>
   </td>
  </tr>
 </td>
</tr>
</table>
<center><br><input type="submit" name="submit" value="Bewerken">
</form>
</center>
<?php }?>
</table>


        
<?php
        }
        exit();
    }
}

if(isset($_GET['edit'])){
    if(!isset($_COOKIE['adminbestellingen'])){
        echo"Je moet wel ingelogd zijn";
        exit();
    }

    if(isset($_COOKIE['adminbestellingen'])){
        $haalop=mysql_fetch_object(mysql_query("SELECT naamkoper, straathuisnr, postcodeplaats, datum, email, product1, product2, product3, aantal1, aantal2, aantal3, bedrag, bedrag1, bedrag2, bedrag3, totaalbedr, status, kleur, tracktrace, ip FROM bestellingen"));?>

        <table width="300px" cellspacing="0">
            <tr>

        <?
        exit();
    }
}

if(isset($_COOKIE['adminbestellingen'])){
    header("location:bewerk.php?controleer=ja");
}

?>


<!-- Het loginscherm -->
<form name="adminlogin" action="<?=$_SERVER['PHP_SELF'];?>?controleer=ja" method="post">
<center>
<font size="2"><b>Admin Login</b></font><br><br></td>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-left-width: 0" bordercolor="#111111" width="100%" id="table1">
<tr>
<table width="240" cellspacing="0">
<tr>
</tr>
<tr>
    <td width="88">Inlognaam:</td>
    <td width="148"><input type="text" name="adminnaam" /></td>
</tr>
<tr>
    <td>Wachtwoord:</td>
    <td width="148"><input type="password" name="password" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><input type="submit" value="Inloggen">
</form>
</td>
</tr>
</table>
</center>
</body>


Hij laat er nu dus maar 1 zien met:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
WHERE id=2


Maar hoe vertel ik hem welke id die moet laden?
Gewijzigd op 01/01/1970 01:00:00 door Patrick Vaarkamp
 
Patrick Vaarkamp

Patrick Vaarkamp

24/03/2009 18:08:00
Quote Anchor link
Probleem opgelost d.m.v. bewerkbestelling.php?controleer=ja&id=67 en

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
$_GET['id']
 



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.