Jump to content

Archived

This topic is now archived and is closed to further replies.

geekazoid

Php Wizzkid Needed

Recommended Posts

Ok, I got a wild man of a script in request here. I know you guys are good at writing scripts but do any of you think you can muster this one ?

A script to rotate randomly each day a differant image placed in a "certain folder" on my server.

So what would happen is, i put one picture in a .html file and rename it 1. then a put some text in the next .html file and rename it 2, and because i have put both the files (1 and 2) into a folder named, Picfold they would both be randomly seleceted EACH DAY ! so one day it would show text then next day it might show a picture. Yea? I have found lots of random page load scripts but i would like one that randomly changed each day ?

Can any one ya wizzards help me out. ? Thanx In advance. And please Explain it as if im thick ( Its not too far from the truth [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /] )

Share this post


Link to post
Share on other sites
Create a mysql (or other) database with a simple table in it, something like this

id - Integer (primary key)
day - text
month - text
year - text
file - text

Each time a visitor loads your page, have it query the database table to see if there is an entry for todays day month and year. if there is, display the file specified in the database, otherwise select one at random, and insert the name of it into the database to be found by the next user.

Share this post


Link to post
Share on other sites
[!--quoteo(post=388790:date=Jun 28 2006, 07:48 AM:name=DaveLinger)--][div class=\'quotetop\']QUOTE(DaveLinger @ Jun 28 2006, 07:48 AM) [snapback]388790[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Something tells me Geekazoid is looking for the freelancing forum.
[/quote]

Sounds that way. Geekazoid, are you looking for someone to write a script for you, or are you simply looking for help with writing one yourself?

Share this post


Link to post
Share on other sites
i would like someone to write one for me, Am i in the wrong forum ? Sorry im new to this website

Share this post


Link to post
Share on other sites
Sorry, but phpfreaks aren't a place where people code for you.
You should try to do it yourself, and if you had any difficulty with your code (example you getting error or can't figure out something) then feel free to ask us.

Share this post


Link to post
Share on other sites
phpfreaks IS a place where people code for you.

Only in this forum: [a href=\"http://www.phpfreaks.com/forums/index.php?showforum=8\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showforum=8[/a]

Share this post


Link to post
Share on other sites
:s I didn't notice that section lolz.
But if you keep asking for others to code for you, you wouldn't get the fun of php. :P

Ok, time for me to sleep, cya everyone tomorrow.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.