Top graphic continually changes - who do they do it?

W

William Tasso

©® said:
the top graphic changes when you go to a
new page or refresh the page.
How do they do it?

there are any number of algos to pick one from a list of items - ask them?
Is there a plugin for Dreamweaver to do this?

no idea
 
H

Hywel Jenkins

©® said:
At http://www.overloaded.com/ the top graphic changes when you go to a
new page or refresh the page.
How do they do it?
Is there a plugin for Dreamweaver to do this?
thanks

Simple. Two ways I can think of:
store all the images in a database and pick one at random

use some server-side scripting to scan a directory of images,
load them into an array and pick one at random. I do that here:
http://new.hyweljenkins.co.uk/
 
D

David Graham

brucie said:
Hi
To get your example to work on my site hosted by phpwebhosting, I take the
php from the second link and rename the file with a .php extension. This
works OK - see http://p0c79.phpwebhosting.com/~p0c79/random-image2.php

But you manage to get this to work from a page with a .html extension - how?

How does the server know it has to process php instructions if the file does
not have a .php extension. Obviously this is possible because you do this
with your example, but once again, how?

thanks
david
 
B

brucie

To get your example to work on my site hosted by phpwebhosting, I take the
php from the second link and rename the file with a .php extension. This
works OK - see http://p0c79.phpwebhosting.com/~p0c79/random-image2.php

But you manage to get this to work from a page with a .html extension - how?

i cant tell you its a big secret.
How does the server know it has to process php instructions if the file does
not have a .php extension.
magic!

Obviously this is possible because you do this with your example, but once
again, how?

oh all right, twist my arm

in a .htaccess file:

AddType application/x-httpd-php .html
 
T

Toby A Inkster

David said:
But you manage to get this to work from a page with a .html extension - how?

How does the server know it has to process php instructions if the file does
not have a .php extension. Obviously this is possible because you do this
with your example, but once again, how?

In an .htacccess file:

AddType application/x-httpd-php .html

This says 'all files with the extension .html are PHP files'. Of course,
the better thing to do is in your .htaccess file:

Options +MultiViews

This means that you don't need to link to 'http://example.org/myfile.php'
or 'http://example.org/myfile.html', you can just link to
'http://example.org/myfile' which is better because in the future you can
replace it with a Perl file, a JSP file or a PDF file -- whichever takes
your fancy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top