sesion probleem
dit probleem heb ik als ik deze pagina open
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
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_once("safe_admin.php");
if(isset($_POST['submit']))
{
if($_POST['Thuis'] != "" AND $_POST['Uit'] != "" AND $_POST['Dag'] != "" AND $_POST['Maand'] != "" AND $_POST['Jaar'] != "" AND $_POST['Uur'] != "" AND $_POST['Min'] != "" AND $_POST['Competitieid'] != ""){
$thuis = $_POST['Thuis'];
$uit = $_POST['Uit'];
$dag = $_POST['Dag'];
$maand = $_POST['Maand'];
$jaar = $_POST['Jaar'];
$uur = $_POST['Uur'];
$min = $_POST['Min'];
$competitieid = $_POST['Competitieid'];
$posterid = $_SESSION['user_id'];
$today = date("d/m/Y H:i");
$sql = "SELECT id FROM voetbal_wedstrijden WHERE thuis='".$thuis."' AND uit='".$uit."' AND dag='".$dag."' AND maand='".$maand."' AND jaar='".$jaar."' AND uur='".$uur."' AND min='".$min."' AND competitieid='".$competitieid."'";
$query = mysql_query($sql);
$count = mysql_num_rows($query);
if($count == 0)
{
$sql2 = "INSERT INTO voetbal_wedstrijden (thuis,uit,dag,maand,jaar,uur,min,competitieid,posterid) VALUES ('".$thuis."','".$uit."','".$dag."','".$maand."','".$jaar."','".$uur."','".$min."','".$competitieid."','".$posterid."')";
echo "Toegevoegd:<br>";
echo "".$thuis." - ".$uit."<br>";
echo "".$dag." / ".$maand." / ".$jaar." om ".$uur." : ".$min."";
echo "".$today."";
$query2 = mysql_query($sql2);
}
else echo "Deze wedstrijd bestaat al $count keer.";
}
else echo "Alles invullen a.u.b.";
$sql = "SELECT competitieid,competitie,land FROM voetbal_competities order by land";
$query = mysql_query($sql);
$aantalrij = mysql_num_rows($query);
?>
include_once("safe_admin.php");
if(isset($_POST['submit']))
{
if($_POST['Thuis'] != "" AND $_POST['Uit'] != "" AND $_POST['Dag'] != "" AND $_POST['Maand'] != "" AND $_POST['Jaar'] != "" AND $_POST['Uur'] != "" AND $_POST['Min'] != "" AND $_POST['Competitieid'] != ""){
$thuis = $_POST['Thuis'];
$uit = $_POST['Uit'];
$dag = $_POST['Dag'];
$maand = $_POST['Maand'];
$jaar = $_POST['Jaar'];
$uur = $_POST['Uur'];
$min = $_POST['Min'];
$competitieid = $_POST['Competitieid'];
$posterid = $_SESSION['user_id'];
$today = date("d/m/Y H:i");
$sql = "SELECT id FROM voetbal_wedstrijden WHERE thuis='".$thuis."' AND uit='".$uit."' AND dag='".$dag."' AND maand='".$maand."' AND jaar='".$jaar."' AND uur='".$uur."' AND min='".$min."' AND competitieid='".$competitieid."'";
$query = mysql_query($sql);
$count = mysql_num_rows($query);
if($count == 0)
{
$sql2 = "INSERT INTO voetbal_wedstrijden (thuis,uit,dag,maand,jaar,uur,min,competitieid,posterid) VALUES ('".$thuis."','".$uit."','".$dag."','".$maand."','".$jaar."','".$uur."','".$min."','".$competitieid."','".$posterid."')";
echo "Toegevoegd:<br>";
echo "".$thuis." - ".$uit."<br>";
echo "".$dag." / ".$maand." / ".$jaar." om ".$uur." : ".$min."";
echo "".$today."";
$query2 = mysql_query($sql2);
}
else echo "Deze wedstrijd bestaat al $count keer.";
}
else echo "Alles invullen a.u.b.";
$sql = "SELECT competitieid,competitie,land FROM voetbal_competities order by land";
$query = mysql_query($sql);
$aantalrij = mysql_num_rows($query);
?>
<form method="POST" action="toevoegen_voetbal.php">
Wedstrijd<br>
<input type="text" name="Thuis" size="20">
-
<input type="text" name="Uit" size="20"><br>
Datum<br>
<select name="Dag" size="1">
<option value=01>1</option>
<option value=02>2</option>
<option value=03>3</option>
<option value=04>4</option>
<option value=05>5</option>
<option value=06>6</option>
<option value=07>7</option>
<option value=08>8</option>
<option value=09>9</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
<option value=24>24</option>
<option value=25>25</option>
<option value=26>26</option>
<option value=27>27</option>
<option value=28>28</option>
<option value=29>29</option>
<option value=30>30</option>
<option value=31>31</option>
</select>
/
<select name="Maand" size="1">
<option value=01>Januari</option>
<option value=02>Februari</option>
<option value=03>Maart</option>
<option value=04>April</option>
<option value=05>Mei</option>
<option value=06>Juni</option>
<option value=07>Juli</option>
<option value=08>Augustus</option>
<option value=09>September</option>
<option value=10>Oktober</option>
<option value=11>November</option>
<option value=12>December</option>
</select>
/
<select name="Jaar" size="1">
<option value=2007>2007</option>
<option value=2008>2008</option>
<option value=2009>2009</option>
</select><br>
Tijd (GMT + 1)<br>
<select name="Uur" size="1">
<option value=00>00</option>
<option value=01>01</option>
<option value=02>02</option>
<option value=03>03</option>
<option value=04>04</option>
<option value=05>05</option>
<option value=06>06</option>
<option value=07>07</option>
<option value=08>08</option>
<option value=09>09</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
</select>
:
<select name="Min" size="1">
<option value=00>00</option>
<option value=01>01</option>
<option value=02>02</option>
<option value=03>03</option>
<option value=04>04</option>
<option value=05>05</option>
<option value=06>06</option>
<option value=07>07</option>
<option value=08>08</option>
<option value=09>09</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
<option value=24>24</option>
<option value=25>25</option>
<option value=26>26</option>
<option value=27>27</option>
<option value=28>28</option>
<option value=29>29</option>
<option value=30>30</option>
<option value=31>31</option>
<option value=32>32</option>
<option value=33>33</option>
<option value=34>34</option>
<option value=35>35</option>
<option value=36>36</option>
<option value=37>37</option>
<option value=38>38</option>
<option value=39>39</option>
<option value=40>40</option>
<option value=41>41</option>
<option value=42>42</option>
<option value=43>43</option>
<option value=44>44</option>
<option value=45>45</option>
<option value=46>46</option>
<option value=47>47</option>
<option value=48>48</option>
<option value=49>49</option>
<option value=50>50</option>
<option value=51>51</option>
<option value=52>52</option>
<option value=53>53</option>
<option value=54>54</option>
<option value=55>55</option>
<option value=56>56</option>
<option value=57>57</option>
<option value=58>58</option>
<option value=59>59</option>
</select><br>
Competitie<br>
<select name="Competitieid" size="1">
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<?
for ($i=1; $i<=$aantalrij; $i++){
$row = mysql_fetch_object($query);
$competitieid = htmlspecialchars($row->competitieid);
$competitie = htmlspecialchars($row->competitie);
$land = htmlspecialchars($row->land);
echo "<option value=$competitieid>$competitie($land)</option>";
}
?>
for ($i=1; $i<=$aantalrij; $i++){
$row = mysql_fetch_object($query);
$competitieid = htmlspecialchars($row->competitieid);
$competitie = htmlspecialchars($row->competitie);
$land = htmlspecialchars($row->land);
echo "<option value=$competitieid>$competitie($land)</option>";
}
?>
</select>
<input type="submit" value="Verzenden" name="submit"><input type="reset" value="Invoer wissen" name="reset"></form>
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?
}
else{
$sql = "SELECT competitieid,competitie,land FROM voetbal_competities order by land";
$query = mysql_query($sql);
$aantalrij = mysql_num_rows($query);
?>
}
else{
$sql = "SELECT competitieid,competitie,land FROM voetbal_competities order by land";
$query = mysql_query($sql);
$aantalrij = mysql_num_rows($query);
?>
<form method="POST" action="toevoegen_voetbal.php">
Wedstrijd<br>
<input type="text" name="Thuis" size="20">
-
<input type="text" name="Uit" size="20"><br>
Datum<br>
<select name="Dag" size="1">
<option value=01>1</option>
<option value=02>2</option>
<option value=03>3</option>
<option value=04>4</option>
<option value=05>5</option>
<option value=06>6</option>
<option value=07>7</option>
<option value=08>8</option>
<option value=09>9</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
<option value=24>24</option>
<option value=25>25</option>
<option value=26>26</option>
<option value=27>27</option>
<option value=28>28</option>
<option value=29>29</option>
<option value=30>30</option>
<option value=31>31</option>
</select>
/
<select name="Maand" size="1">
<option value=01>Januari</option>
<option value=02>Februari</option>
<option value=03>Maart</option>
<option value=04>April</option>
<option value=05>Mei</option>
<option value=06>Juni</option>
<option value=07>Juli</option>
<option value=08>Augustus</option>
<option value=09>September</option>
<option value=10>Oktober</option>
<option value=11>November</option>
<option value=12>December</option>
</select>
/
<select name="Jaar" size="1">
<option value=2007>2007</option>
<option value=2008>2008</option>
<option value=2009>2009</option>
</select><br>
Tijd (GMT + 1)<br>
<select name="Uur" size="1">
<option value=00>00</option>
<option value=01>01</option>
<option value=02>02</option>
<option value=03>03</option>
<option value=04>04</option>
<option value=05>05</option>
<option value=06>06</option>
<option value=07>07</option>
<option value=08>08</option>
<option value=09>09</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
</select>
:
<select name="Min" size="1">
<option value=00>00</option>
<option value=01>01</option>
<option value=02>02</option>
<option value=03>03</option>
<option value=04>04</option>
<option value=05>05</option>
<option value=06>06</option>
<option value=07>07</option>
<option value=08>08</option>
<option value=09>09</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
<option value=24>24</option>
<option value=25>25</option>
<option value=26>26</option>
<option value=27>27</option>
<option value=28>28</option>
<option value=29>29</option>
<option value=30>30</option>
<option value=31>31</option>
<option value=32>32</option>
<option value=33>33</option>
<option value=34>34</option>
<option value=35>35</option>
<option value=36>36</option>
<option value=37>37</option>
<option value=38>38</option>
<option value=39>39</option>
<option value=40>40</option>
<option value=41>41</option>
<option value=42>42</option>
<option value=43>43</option>
<option value=44>44</option>
<option value=45>45</option>
<option value=46>46</option>
<option value=47>47</option>
<option value=48>48</option>
<option value=49>49</option>
<option value=50>50</option>
<option value=51>51</option>
<option value=52>52</option>
<option value=53>53</option>
<option value=54>54</option>
<option value=55>55</option>
<option value=56>56</option>
<option value=57>57</option>
<option value=58>58</option>
<option value=59>59</option>
</select><br>
Competitie<br>
<select name="Competitieid" size="1">
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<?
for ($i=1; $i<=$aantalrij; $i++){
$row = mysql_fetch_object($query);
$competitieid = htmlspecialchars($row->competitieid);
$competitie = htmlspecialchars($row->competitie);
$land = htmlspecialchars($row->land);
echo "<option value=$competitieid>$competitie($land)</option>";
}
?>
for ($i=1; $i<=$aantalrij; $i++){
$row = mysql_fetch_object($query);
$competitieid = htmlspecialchars($row->competitieid);
$competitie = htmlspecialchars($row->competitie);
$land = htmlspecialchars($row->land);
echo "<option value=$competitieid>$competitie($land)</option>";
}
?>
</select>
<input type="submit" value="Verzenden" name="submit"><input type="reset" value="Invoer wissen" name="reset"></form>
De fout zit in config.php op regel 5 hier staat
session_start();
alle pagina's waar ik config.php include doen het maar deze niet
Beetje onzinnig lange post.
Je moet beginnen met session_start(), en daarna uitvoer naar de browser starten.