/    Sign up×
Community /Pin to ProfileBookmark

image control file

Hi i am new here, but have come across an issue i need help with.

Can a php file control how many times an image is displayed in a html file?

So if 10 people were to visit a site, the image only gets displayed 4 times, the number needs to be editable, so it can change.

If you could help that would be great, if you think that another language / script would be better at doing this, please suggest.

Thanks

Nathan

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@dave17Nov 28.2007 — you need some place to store a static counter, scripts variables are obviously lost after the script is finished running. some options are to use a database to maintain how many times is can be display and has been displayed, or just use a file to read/write variables.
Copy linkTweet thisAlerts:
@ziztherauthorNov 28.2007 — Thanks for that

What would you suggest to bes the best idea?
Copy linkTweet thisAlerts:
@dave17Nov 28.2007 — well databases are pretty essential to most websites, but its some work to create one and getting working with php. if this is all you want to and you just want a quick and easy way, then just use php file functions to read/write whatever permanent variables you need to a file.
Copy linkTweet thisAlerts:
@ziztherauthorNov 28.2007 — Yeah i agree, i think it would be a waste to use a database!

Thanks
×

Success!

Help @zizther 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.4,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...