我对这个roate.php有问题。
我做了这里描述的一切PHP随机图像旋转。但是照片出现了。这就是我的代码的样子。
style.css
.header_img {
overflow: hidden;
width: 1010px;
margin: 0 auto;
height: 276px;
background: url(../header/rotate.php) no-repeat center 0;
border-width: 0 1px;
main.tpl
<!-- /header -->
</header>
<div id="header_img">
<div class="header_img"><!-- no text --></div>
</div>
我是一个初学者,这对我来说是全新的。所以我希望有人能在这里帮助我。
向致以最良好的问候
您遇到的问题不是rotate.php和dle脚本的问题,而是将"rotate.php"文件放在哪里的问题,您不能将任何php文件放在主题文件夹中,它将被脚本和htaccess阻止,所以解决方案很简单,在"templates"文件夹外的根目录中创建新文件夹,例如:"header"或"background"
然后将所有图像和rotate.php放在该文件夹中,这样您就可以访问该文件夹和等图像
http://your-domain.com/header/rotate.php
http://your-domain.com/header/image-1.php
http://your-domain.com/header/image-2.php
...
or
---
http://your-domain.com/background/rotate.php
http://your-domain.com/background/image-1.php
http://your-domain.com/background/image-2.php
你的main.tpl应该像这个
<style type="text/css">
.header_img {
overflow: hidden;
width: 1010px;
margin: 0 auto;
height: 276px;
background: url(/header/rotate.php) no-repeat center 0;
/* or */
/*
background: url(/background/rotate.php) no-repeat center 0;
*/
border-width: 0 1px;
</style>
<!-- /header -->
</header>
<div id="header_img">
<div class="header_img"><!-- no text --></div>
</div>
将任何php文件从"templates"文件夹中删除。并且不要将css放在任何css文件中,将所有代码放在main.tpl.中
或者,你可以使用这种技术,我们在一些网站上使用,我们为他们设计了
1) 从A List Apart下载rotar.txt,将其重命名为rotar.php。
2) 将要旋转的图像放在与rotator.php.相同的目录中
3) 通过FTP上传所有文件。
4) 在main.tpl 中添加此代码
<style type="text/css">
#rotator{
overflow: hidden;
width: 1010px;
margin: 0 auto;
height: 276px;
background: url(/background/rotate.php) no-repeat center 0;
border-width: 0 1px;
</style>
<!-- /header -->
</header>
<div id="rotator"> </div>