php sessie geeft niks terug
Ik begrijp niet wat ik fout doe in de onderstaande code. Voegtoe word om de 1 of andere manier niet gevuld of gedefineerd??
Code (php)
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
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
<?php
error_reporting(E_ALL);
session_start();
//if $voegtoe = < 1
//{
//}
$dbLink = mysql_connect("localhost","140802","");
mysql_select_db('140802');
$strSqlCode = "SELECT * FROM producten;";
$oResultaat = mysql_query($strSqlCode);
print ("<table width=950 border=0>");
print ("<tr>");
print ("<td>");
print ("<b>");
print "product_id";
print ("</td>");
print ("</b>");
print ("<td>");
print ("<b>");
print "bestel";
print ("</td>");
print ("</b>");
While ($row = mysql_fetch_array($oResultaat))
{
print ("<tr>");
print ("<td>");
print $row['product_id'];
print ("</td>");
print ("<td>");
print ("<a href='?voegtoe=$row[product_id]'><img src='images/cart.jpg' border='0'>");
$_SESSION['voegtoe'] = $_GET['voegtoe'];
print ("</td>");
} //while loop word afgesloten
print ("</tr>");
print ("</table>");
//else
//{
//print "leeg";
//}
print $voegtoe;
print $voegtoe;
print $voegtoe;
?>
error_reporting(E_ALL);
session_start();
//if $voegtoe = < 1
//{
//}
$dbLink = mysql_connect("localhost","140802","");
mysql_select_db('140802');
$strSqlCode = "SELECT * FROM producten;";
$oResultaat = mysql_query($strSqlCode);
print ("<table width=950 border=0>");
print ("<tr>");
print ("<td>");
print ("<b>");
print "product_id";
print ("</td>");
print ("</b>");
print ("<td>");
print ("<b>");
print "bestel";
print ("</td>");
print ("</b>");
While ($row = mysql_fetch_array($oResultaat))
{
print ("<tr>");
print ("<td>");
print $row['product_id'];
print ("</td>");
print ("<td>");
print ("<a href='?voegtoe=$row[product_id]'><img src='images/cart.jpg' border='0'>");
$_SESSION['voegtoe'] = $_GET['voegtoe'];
print ("</td>");
} //while loop word afgesloten
print ("</tr>");
print ("</table>");
//else
//{
//print "leeg";
//}
print $voegtoe;
print $voegtoe;
print $voegtoe;
?>