在我的网站上,我有 php 编码和一个允许用户上传图像的 sql 数据库,它会自动用新图像更新主页并将它们与标签连接起来,并允许你 2 拉出一个所有图像都连接到标签的页面。对于示例,请访问 fap-book.com 以查看图像是否正常工作。
我试图创建另一个对视频执行相同操作的页面,但我无法让它在视频页面上播放视频。
<?php
$z=1;
$res=$ob->alltags();
while($row=mysql_fetch_array($res))
{
$tag=$row['tags'];
$slug=$row['slug'];
$sno=$row['sno'];
$img1=$ob->all($sno);
while($row1=mysql_fetch_array($img1))
{
$img=$row1['image'];
$sno1=$row1['sno'];
$like=$row1['lik'];
$dislike=$row1['dislike'];
}
if($z==1)
{
echo"<div style='width:1000px;height:354px; '>
<div style='float:left; width:250px;'>
<div style='background-image:url(images/tab-top.png);width:244px;height:34px; '><div style='font-size:18px;color:#2c011f;text-align:center;font-weight:bold;padding-top:5px;'><a href='search.php?tag=$slug' style='font-size:18px;color:#2c011f;text-align:center;font-weight:bold;padding-top:5px;text-decoration:none;'>$tag</a></div></div>
<div style='width:240px;height:280px;background-color:#b01147; margin-left:2px;'>
<div id='gallery' style='margin-left:-40px;margin-top:-16px;'>
<ul>
<li>
<a href='images/video/$img.wmv' title=''>
<video src='images/video/$img.wmv' style='width:240px;height:280px; ' alt='' />
</a>
</li>
</ul>
</div>
</div>
<div style='background-image:url(images/tab-bottom.png);width:244px;height:30px; '>";
echo '<div class="product_list">';
echo '<div class="product_like" style="float:left;margin-top:3px;margin-left:20px;"><img src="images/like.png" onclick=changeLikeDislike("lik","'.$sno1.'")> </div><div id="product_lik_'.$sno1.'" style="color:#fff;float:left;margin-top:3px;">'.$like.'</div>';
echo '<div class="product_dislike" style="float:left;margin-top:3px;"><img src="images/dislike.png" onclick=changeLikeDislike("dislike","'.$sno1.'")> </div><div id="product_dislike_'.$sno1.'" style="color:#fff;float:left;margin-top:3px;">'.$dislike.'</div>';
echo '<div class="product_flash" id="product_flash_'.$sno1.'" style="float:left;margin-top:5px;color:#fff;font-size:12px;margin-left:5px;"> </div>';
$r=mysql_query("select sno from comments where image_sno='".$sno1."'");
$cnt=mysql_num_rows($r);
echo '<div class="" id="" style="float:right;margin-top:2px;color:#fff;font-size:12px;margin-right:20px;">';
if(isset($_SESSION['admin']))
{
echo'<a href="delete.php?sno='.$sno1.'" style="float:right;margin-top:5px;margin-left:5px;"><img src="images/close.png" width="15" height="15"></a>';
}
echo'<a href="comments.php?id='.$sno1.'"><img src="images/comment.png" style="width:15p;height:25px;"></a></div><div style="color:#fff;float:right;margin-top:5px;">'.$cnt.'</div>';
echo '</div>';
echo"</div></div>";
}
else
{
echo"<div style='float:left; width:250px;'>
<div style='background-image:url(images/tab-top.png);width:244px;height:34px; '><div style='font-size:18px;color:#2c011f;text-align:center;font-weight:bold;padding-top:5px;'><a href='search.php?tag=$slug' style='font-size:18px;color:#2c011f;text-align:center;font-weight:bold;padding-top:5px;text-decoration:none;'>$tag</a></div></div>
<div style='width:240px;height:280px;background-color:#b01147; margin-left:2px;'>
<div id='gallery' style='margin-left:-40px;margin-top:-16px;'>
<ul>
<li>
<a href='images/video/$img.wmv' title=''>
<video src='images/video/$img.wmv' style='width:240px;height:280px; ' alt='' />
</a>
</li>
</ul>
</div>
</div>
<div style='background-image:url(images/tab-bottom.png);width:244px;height:30px; '>";
echo '<div class="product_list">';
echo '<div class="product_like" style="float:left;margin-top:3px;margin-left:20px;"><img src="images/like.png" onclick=changeLikeDislike("lik","'.$sno1.'")> </div><div id="product_lik_'.$sno1.'" style="color:#fff;float:left;margin-top:3px;">'.$like.'</div>';
echo '<div class="product_dislike" style="float:left;margin-top:3px;"><img src="images/dislike.png" onclick=changeLikeDislike("dislike","'.$sno1.'")> </div><div id="product_dislike_'.$sno1.'" style="color:#fff;float:left;margin-top:3px;">'.$dislike.'</div>';
echo '<div class="product_flash" id="product_flash_'.$sno1.'" style="float:left;margin-top:5px;color:#fff;font-size:12px;margin-left:5px;"> </div>';
$r=mysql_query("select sno from comments where image_sno='".$sno1."'");
$cnt=mysql_num_rows($r);
echo '<div class="" id="" style="float:right;margin-top:2px;color:#fff;font-size:12px;margin-right:20px;">';
if(isset($_SESSION['admin']))
{
echo'<a href="delete.php?sno='.$sno1.'" style="float:right;margin-top:5px;margin-left:5px;"><img src="images/close.png" width="15" height="15"></a>';
}
echo'<a href="comments.php?id='.$sno1.'"><img src="images/comment.png" style="width:15p;height:25px;"></a></div><div style="color:#fff;float:right;margin-top:5px;">'.$cnt.'</div>';
echo '</div>';
echo"</div>
</div>";
if($z==4)
{
$z=0;
echo"</div>";
}
}
$z++;
}
?>
<div style="width:1000px;height:76px;background-image:url(images/all-top.png);background-repeat:no-repeat;margin-left:8px; "></div>
<div style="width:1000px;background-image:url(images/all-body.png);background-repeat:repeat-y; ">
<table style="width:970px;margin:0 auto; " border="0">
<?php
$z=1;
$res=$ob->alltags();
while($row=mysql_fetch_array($res))
{
$tag=$row['tags'];
$slug=$row['slug'];
$sno=$row['sno'];
$img=$ob->all($sno);
if($z==1)
{
echo"<tr><td><div style='width:238px;height:24px;background-color:#533c36;margin-right:2px; '><a href='search.php?tag=$slug' style='font-size:17px;padding-left:10px;color:#ffcc33;text-decoration:none; '>$tag</a></div><hr style='border-style:dotted;margin-top:-0px;width:238px;margin-left:-0px; '></td>";
}
else
{
echo"<td><div style='width:238px;height:24px;background-color:#533c36;margin-right:2px; '><a href='search.php?tag=$slug' style='font-size:17px;padding-left:10px;color:#ffcc33;text-decoration:none; '>$tag</a></div><hr style='border-style:dotted;margin-top:-0px;width:238px;margin-left:-0px; '></td>";
if($z==4)
{
$z=0;
echo"</tr>";
}
}
$z++;
}
?>
</table>
我不确定我需要做些什么来修复它或者它是否可以修复