如何使用图像滑块的PHP

时间:2012-11-15 14:40:49

标签: php html css

只想在屏幕上显示第一个图像,并希望手动滑动图像,在图像屏幕上显示一个选项,指示要滑动,即使用户点击特定图像,它也应放大同一窗口

任何人都可以帮忙..?这是显示代码,在php

$con=mysql_connect("localhost","root","");
mysql_select_db("menu",$con);
$sql="select * from nonmenu where nid=$a";
echo "$sql";
$result=mysql_query($sql);

//$row=mysql_fetch_array($result);

$row=mysql_fetch_array($result);

      <img src="upload/<?php  echo $row['nphoto'];?>" height=120 width= 160 alt="" />
          <img src="upload/<?php  echo $row['nphoto1'];?>" height=120 width= 160 alt="" />     <img src="upload/<?php  echo $row['nphoto2'];?>" height=120 width= 160 alt="" /> 
<img src="upload/<?php  echo $row['nphoto3'];?>" height=120 width= 160 alt="" /> 


          <img src="upload/<?php  echo $row['nphoto4'];?>" height=150 width= 160 alt="" /> 
         <img src="upload/<?php  echo $row['nphoto5'];?>" height=150 width= 160 alt="" /> 
           <img src="upload/<?php  echo $row['nphoto6'];?>" height=150 width= 160 alt="" />            <img src="upload/<?php  echo $row['nphoto7'];?>" height=150 width= 160 alt="" /> 

1 个答案:

答案 0 :(得分:1)

首先在PHP代码的这个小小的平静中看到你的错误

<?php

$con=mysql_connect("localhost","root","");
mysql_select_db("menu",$con);
$sql='select * from nonmenu where nid="'.$a.'"';
echo $sql;
$result=mysql_query($sql);

?>

其次 “height =”120“width =”160“alt =”“/&gt; 而是尝试

echo '<img src= "'.$YOUR_URL.'" alt=""/>';