带有 codeigniter 的图片库
我在服务器上的文件夹中上传了一些图像,并且存储了它们的路径 在我的数据库的一个表中。在浏览器上显示此图像(作为图库)的最佳方式是什么?
我应该使用 jQuery 还是 CodeIgniter 可以完成这项工作?
I have some images uploaded in a folder on my server, and their paths are stored
in a table in my database. Whats the best way to display this images on the browser(as a gallery)?
Should I use jQuery or maybe CodeIgniter could do the job?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我倾向于同意您可能有点困惑。这里必须发生两个部分。
执行 #1 的方法几乎有无数种,它们完全依赖于您的数据库配置、服务器等。使用带有 Active Record 的 CodeIgniter,并假设您已经有一个活动的数据库连接,PHP 看起来像这样这:
第二个最容易通过使用类似 jQuery + ColorBox。实际上有数百个 jQuery 画廊/幻灯片/照片插件。如果您有兴趣环顾四周,这里有一堆 此处。
I tend to agree that you're probably a little bit confused. There are two components that have to happen here.
There are almost an infinite number of ways to perform #1, and they are totally dependent on your database configuration, server, etc. Using CodeIgniter with Active Record, and assuming that you already have an active database connection, the PHP would look something like this:
Number two is most easily handled by using something like jQuery + ColorBox. There are literally hundreds of gallery/slideshow/photo plugins for jQuery. If you're interested in looking around, there are a bunch here.
只需对表进行一个非常简单的查询即可,我认为您对 jquery 和 codeigniter 的作用感到困惑!对于这样的事情,只需使用一些简单的 PHP:
Just a very simple query on the table will do, I think your getting confused as to what jquery and codeigniter do! For something like this just use some simple PHP: