25-04-2011, 13:29
|
#1
|
|
cf.mega poster
Join Date: Jun 2003
Posts: 4,952
|
php question
I have a wordpress blog set up and I want the header image to rotate randomly, so I use this script http://www.alistapart.com/d/randomizer/rotate.txt (rename it to rotate.php)
and put this in CSS file
image:url(images/headers/rotate.php);
background-repeat:no-repeat;
background-position:top;
height:309px;
}
But the when I go to the rotate.php the website returns the text of the script instead of executing it.
How do I get it to execute?
__________________
"Knowledge is Power. Power Corrupts. Study Hard. Be Evil."
|
|
|
25-04-2011, 13:52
|
#2
|
|
cf.mega poster
Join Date: Nov 2010
Location: Stafford
Posts: 4,225
|
Re: php question
image:url(images/headers/rotate.php);
image: isnt a css property and:
rotate.php is the script file, and cant be added as an image anyway (image=picture)
i havnt used wordpress, is it PHP?
for php, you will want something like:
include 'images/headers/rotate.php';
for HTML you will want
<!--#include file="images/headers/rotate.php" -->
insert this line of code into the page, not the css
|
|
|
25-04-2011, 14:14
|
#3
|
|
cf.mega poster
Join Date: Jun 2003
Posts: 4,952
|
Re: php question
the image property was in the original wordpress css file.
I was following the instructions here: http://sonspring.com/journal/easy-ra...ss-backgrounds
And wordpress is php
__________________
"Knowledge is Power. Power Corrupts. Study Hard. Be Evil."
|
|
|
25-04-2011, 16:08
|
#4
|
|
cf.mega poster
Join Date: Nov 2010
Location: Stafford
Posts: 4,225
|
Re: php question
background: url(images/rotator.php);
thats right, you had
image: url(images/rotator.php)
|
|
|
25-04-2011, 17:13
|
#5
|
|
cf.mega poster
Join Date: Jun 2003
Posts: 4,952
|
Re: php question
sorry I didn't copy it properly:
this is what doesn't work
#main-img{
width:906px;
background-image:url(images/headers/rotate.php);
background-repeat:no-repeat;
background-position:top;
height:309px;
}
__________________
"Knowledge is Power. Power Corrupts. Study Hard. Be Evil."
|
|
|
25-04-2011, 20:17
|
#6
|
|
Inactive
Join Date: Jul 2003
Location: Poole, Dorset
Age: 41
Services: FreeSat+
Tivo
V-Box
VM 60MBit
Posts: 13,365
|
Re: php question
.php files can be linked as images as they can be set to return an encoded image file rather than text, downquark, maybe you could link me to your site so I can take a look
|
|
|
26-04-2011, 00:35
|
#7
|
|
cf.mega poster
Join Date: Nov 2010
Location: Stafford
Posts: 4,225
|
Re: php question
but "image:" isnt a css property
|
|
|
26-04-2011, 12:46
|
#8
|
|
cf.mega poster
Join Date: Jun 2003
Posts: 4,952
|
Re: php question
Thanks to Graham for solving my problem. Some how some screwy metadata had got inserted into the file without me noticing.
__________________
"Knowledge is Power. Power Corrupts. Study Hard. Be Evil."
|
|
|
26-04-2011, 17:25
|
#9
|
|
Inactive
Join Date: Jul 2003
Location: Poole, Dorset
Age: 41
Services: FreeSat+
Tivo
V-Box
VM 60MBit
Posts: 13,365
|
Re: php question
Basically something can converted all of the symbols in the code to HTML characters like < for instance and some data had been inserted that didn't belong which would have corrupted the output images anyway
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 14:45.
|