.php?id=4 moet ook echt id 4 laten zien
Wat kan ik hieraan doen en hoe kan ik dit oplossen? Graag hulp, hier is de code...
De code van de pagina met de lijst van de video's, deze doet wel wat ie hoort te doen.
<table height=2% width=680 border=0 bordercolor=black>
<tr><td height=1%></td><td background=menu.gif align=center>Hier kan je kiezen welk filmpje je wilt zien!</td></tr>
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
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
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("host","user","pass");
//select which database you want to edit
mysql_select_db("database");
//select the table
$result = mysql_query("select * from video order by id desc");
//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
$id=$r["id"];
$titel=$r["titel"];
$date=$r["date"];
$beschrijving=$r["beschrijving"];
$foto=$r["foto"];
$video=$r["video"];
//display the row
echo "<tr><td height=2% width=81><a href=\"{$phpfile}?id={$id}\"><img src=video/$foto width=80 height=80 border=0></a></td>";
echo "<td><table height=100% width=100%><tr><td><table width=100% height=100%><tr><td align=left><b><font color=white><a href=\"{$phpfile}?id={$id}\">$titel</a></font></b></td><td align=right>$date</td></tr></table></td></tr><tr><td>$beschrijving</td></tr></table>";
echo "</td></tr>";
}
?>
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("host","user","pass");
//select which database you want to edit
mysql_select_db("database");
//select the table
$result = mysql_query("select * from video order by id desc");
//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
$id=$r["id"];
$titel=$r["titel"];
$date=$r["date"];
$beschrijving=$r["beschrijving"];
$foto=$r["foto"];
$video=$r["video"];
//display the row
echo "<tr><td height=2% width=81><a href=\"{$phpfile}?id={$id}\"><img src=video/$foto width=80 height=80 border=0></a></td>";
echo "<td><table height=100% width=100%><tr><td><table width=100% height=100%><tr><td align=left><b><font color=white><a href=\"{$phpfile}?id={$id}\">$titel</a></font></b></td><td align=right>$date</td></tr></table></td></tr><tr><td>$beschrijving</td></tr></table>";
echo "</td></tr>";
}
?>
</table>
en dan de afspeel pagina
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
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
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("host","user","pass");
//select which database you want to edit
mysql_select_db("database");
//select the table
$result = mysql_query("select * from video limit 1");
//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
$id=$r["id"];
$titel=$r["titel"];
$date=$r["date"];
$beschrijving=$r["beschrijving"];
$foto=$r["foto"];
$video=$r["video"];
$maker=$r["maker"];
//display the row
echo "<table width=427 height=302 border=1 bordercolor=black>";
echo "<tr><td background=menu.gif align=center height=1%><b>$titel, $id</b></td></tr>";
echo "<tr><td><a href=video/$video style=display:block;width:425px;height:300px; id=player> </a>";
echo "</td></tr><tr><td align=left>$beschrijving</td></tr>";
echo "<tr><td><b>Verdere info:</b> Datum toegevoegd: $date, Maker: $maker</td></tr></table>";
}
?>
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("host","user","pass");
//select which database you want to edit
mysql_select_db("database");
//select the table
$result = mysql_query("select * from video limit 1");
//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
$id=$r["id"];
$titel=$r["titel"];
$date=$r["date"];
$beschrijving=$r["beschrijving"];
$foto=$r["foto"];
$video=$r["video"];
$maker=$r["maker"];
//display the row
echo "<table width=427 height=302 border=1 bordercolor=black>";
echo "<tr><td background=menu.gif align=center height=1%><b>$titel, $id</b></td></tr>";
echo "<tr><td><a href=video/$video style=display:block;width:425px;height:300px; id=player> </a>";
echo "</td></tr><tr><td align=left>$beschrijving</td></tr>";
echo "<tr><td><b>Verdere info:</b> Datum toegevoegd: $date, Maker: $maker</td></tr></table>";
}
?>
<script language="JavaScript">
flowplayer("player", "video/flowplayer-3.1.3.swf");
</script>
Dankjewel! het werkt gewoon!!
Google eens op SQL Injection.
Die limit 1 is ook nergens voor nodig.
Gewijzigd op 01/01/1970 01:00:00 door Mr.Ark
en wat bedoel je daarmee?
Jelmer schreef op 04.10.2009 01:05:
en wat bedoel je daarmee?
Je script is lek=> sql-injection.
En de limit is niet nodig omdat het id uniek is. Dus er is er maar 1.
maar, als ik dus dat limit weg haal is dan alles goed? en wat is precies een sql-injection?
oke, dankje :D