/    Sign up×
Community /Pin to ProfileBookmark

Random Image with Text description (PHP)

I have heard that PHP will give me a way to have pictures from various folders change as i program it to. My question is before I get PHP running (which I still dont know how to do, lol).

How does PHP know where to put the Pictures that I choose to have randomized?

Also, If I want a description and some other info how do I get that to apear with the photo?

Any help would be appreciated. Thank you

HexFactor

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 06.2005 — Typically it's not a case of putting the pictures anywhere. Rather, it's a case of having PHP code in the page that randomly selects a picture from a list of many allowed possibilities. That "list" could be a database table, a text file, or hard-coded into the page. The list could have the directory, file name, and description text for each picture. Then your code just has to randomly select one row from the list and use that row's information to display the picture and description.
×

Success!

Help @Hexfactor spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.10,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...