Probleempje
Ik zit met een klein probleempje. Ik heb namelijk een script gemaakt waar je clips kan mee bekijken. Nu is het volgende. Je hebt de pagina clips.php, en elke clip heeft een id, nu, als ik op de naam klik van het filmpje, wordt hij niet doorgestuurd. ik zie wel de juiste link (clips.php?id=1) maar toch roept hij niets aan. Waar loopt het fout
De code
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
64
65
66
67
68
69
70
71
72
73
74
75
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
<?
require("configp.php");
//Connect To Mysql
mysql_connect($config[dbHost],$config[dbUser],$config[dbPass]);
mysql_select_db($config[dbName]);
if(!$id){
$query = mysql_query("SELECT * FROM clips");
$result = mysql_num_rows($query);
if(!$result){
echo "We Don't Have Any Clips";
}
else{
?>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="515">
<tr><td><font size=1 face=verdana color="3e3e3e"><b>ID</td><td><b><font size=1 face=verdana color="3e3e3e">Filename</td><td><font size=1 face=verdana color="3e3e3e"><b>Clicks</td></tr>
<?
while($object = mysql_fetch_object($query)){
?>
<tr><td><font size=1 face=verdana color="3e3e3e"> <? echo $object->id ?></td><td><font size=1 face=verdana color="white"> <a href="clips.php?id=<? echo $object->id ?>"><? echo $object->filename ?></a></td><td><font size=1 face=verdana color="3e3e3e"> <?php echo $object->clicks ?></td></tr>
<?
}
}
echo "</table>";
}
else{
$query = mysql_query("SELECT * FROM clips WHERE id = '$id'");
$result = mysql_num_rows($query);
if(!$result){
echo "This file don't excist";
}
else{
mysql_query("UPDATE clips SET clicks = clicks + 1 WHERE id = '$id'");
while($object = mysql_fetch_object($query)){
?>
<font size="2" face="verdana"><b>Filename: <? echo $object->filename ?></b></font><hr color="555555">
<center>
<OBJECT ID="MediaPlayer" width=350 height=250
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase=
"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
#### encoding problem on this line, not shown ####
type="application/x-oleobject" style="border: 1px dotted #555555">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM NAME="AutoSize" VALUE="True">
<PARAM NAME="DisplaySize" VALUE="1">
<param name="EnableContextMenu" value="True">
<PARAM NAME="FileName" VALUE="http://<? echo $object->fileURL ?>">
<PARAM NAME="ShowControls" VALUE="False">
<PARAM NAME="ShowStatusBar" VALUE="True">
<EMBED type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
SRC="http://<? echo $object->fileURL ?>"
width=425
height=293
DisplaySize=0
EnableContextMenu=0
autostart=1
ShowStatusBar=1
showcontrols=0> </EMBED>
</OBJECT></center><br>
<font size="1" face="verdana">
<b>Clicks:</b> <?php echo $object->clicks ?><br>
<b>Source:</b> <?php echo $object->source ?><br>
<b>Submited On:</b> <?php echo $object->subdate ?><br>
<b>Submited By:</b> <?php echo $object->subname ?><br><br>
<a href="clips.php"><b><< go back</b></a>
<?
}
}
}
?>
require("configp.php");
//Connect To Mysql
mysql_connect($config[dbHost],$config[dbUser],$config[dbPass]);
mysql_select_db($config[dbName]);
if(!$id){
$query = mysql_query("SELECT * FROM clips");
$result = mysql_num_rows($query);
if(!$result){
echo "We Don't Have Any Clips";
}
else{
?>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="515">
<tr><td><font size=1 face=verdana color="3e3e3e"><b>ID</td><td><b><font size=1 face=verdana color="3e3e3e">Filename</td><td><font size=1 face=verdana color="3e3e3e"><b>Clicks</td></tr>
<?
while($object = mysql_fetch_object($query)){
?>
<tr><td><font size=1 face=verdana color="3e3e3e"> <? echo $object->id ?></td><td><font size=1 face=verdana color="white"> <a href="clips.php?id=<? echo $object->id ?>"><? echo $object->filename ?></a></td><td><font size=1 face=verdana color="3e3e3e"> <?php echo $object->clicks ?></td></tr>
<?
}
}
echo "</table>";
}
else{
$query = mysql_query("SELECT * FROM clips WHERE id = '$id'");
$result = mysql_num_rows($query);
if(!$result){
echo "This file don't excist";
}
else{
mysql_query("UPDATE clips SET clicks = clicks + 1 WHERE id = '$id'");
while($object = mysql_fetch_object($query)){
?>
<font size="2" face="verdana"><b>Filename: <? echo $object->filename ?></b></font><hr color="555555">
<center>
<OBJECT ID="MediaPlayer" width=350 height=250
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase=
"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
#### encoding problem on this line, not shown ####
type="application/x-oleobject" style="border: 1px dotted #555555">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM NAME="AutoSize" VALUE="True">
<PARAM NAME="DisplaySize" VALUE="1">
<param name="EnableContextMenu" value="True">
<PARAM NAME="FileName" VALUE="http://<? echo $object->fileURL ?>">
<PARAM NAME="ShowControls" VALUE="False">
<PARAM NAME="ShowStatusBar" VALUE="True">
<EMBED type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
SRC="http://<? echo $object->fileURL ?>"
width=425
height=293
DisplaySize=0
EnableContextMenu=0
autostart=1
ShowStatusBar=1
showcontrols=0> </EMBED>
</OBJECT></center><br>
<font size="1" face="verdana">
<b>Clicks:</b> <?php echo $object->clicks ?><br>
<b>Source:</b> <?php echo $object->source ?><br>
<b>Submited On:</b> <?php echo $object->subdate ?><br>
<b>Submited By:</b> <?php echo $object->subname ?><br><br>
<a href="clips.php"><b><< go back</b></a>
<?
}
}
}
?>
'$id' kan toch niet? dat moet dan toch met " en "?
ergens zou er $id = $_POST['id'];
moeten staan denk ik
Zet dat dan ff boven in je script:
Code (php)
1
2
3
4
5
6
7
2
3
4
5
6
7
<?
require("configp.php");
$id = $_POST['id']
//Connect To Mysql
mysql_connect($config[dbHost],$config[dbUser],$config[dbPass]);
mysql_select_db($config[dbName]);
?>
require("configp.php");
$id = $_POST['id']
//Connect To Mysql
mysql_connect($config[dbHost],$config[dbUser],$config[dbPass]);
mysql_select_db($config[dbName]);
?>
Doe maar GET want hij staat in een URL.
This file don't excist
Dit is de code om die info uit men MySQL te halen.
Code (php)
1
2
3
4
5
2
3
4
5
<?
else{
$query = mysql_query("SELECT * FROM clips WHERE id = '$id'");
$result = mysql_num_rows($query);
?>
else{
$query = mysql_query("SELECT * FROM clips WHERE id = '$id'");
$result = mysql_num_rows($query);
?>
Lijkt mij een php error en geen mysql.
Edit:
Foute post, het is een fout inderdaad dat die het bestand niet kan vinden.. Kopieer de locatie eens uit de bron, plak dat in je browser en kijk of dat werkt.
Foute post, het is een fout inderdaad dat die het bestand niet kan vinden.. Kopieer de locatie eens uit de bron, plak dat in je browser en kijk of dat werkt.
Gewijzigd op 01/01/1970 01:00:00 door Robert Deiman