I want to have ONE picture on my home page (a poster) and when the date is done I want the new one to replace it and the old to go to a list of all the previous posters.

if anyone has a snippet of code that would be amazing.

thanks

Recommended Answers

All 4 Replies

since you are a new member, I would say you would be likely to get some participation on this thread if you first give it a try and then ask for help with regard to the specific areas/components you get stuck on.

this sounds like more than just a snippet of code, plus whatever code is used to address the requirement would have to be integrated with existing code.

At a high level, I would think that one way to design this is to have your posters stored as pictures on the file system. You are going to have a data source, such as a database, or it can be an XML file, etc... with the picture info, location, numbering or index info..something to track the picture.

Then build server side code to read from the DB and look for the picture based on some value according to the current date/day/month, etc.. When the picture has been showcased, then flag it so its tracked appropriately..

I used daniwebs when I was in highschool, my teacher referred me to it, haven't used it since. but That's what i was thinking, i have the fields ready in my database (ex 10/25/13).

I'm just not a hundred percent sure how i would script to termenate a picture on a date. would it be a if statement?

like obvs make a string and echo the id of the picture displaying it. i'm currently in the "mock up," of a friends site and i want to make sure i can do it before i tell her.

should i script the website than when get stuck post the code on here?

I used daniwebs when I was in highschool, my teacher referred me to it, haven't used it since.

Ok, since you only had one post, I assumed you were a new member, didnt occur to me that you may have visited before.

would it be a if statement?

Yes, its very likely you are going to need conditional statements in your code..exactly where hard to say at this point without seeing code, but conditional statements allow you to add "work flow" in your program.

So I suspect that in your data source, you are storing these posters with a start and end date. In your PHP code, you will need to get today's date and find the poster that includes today's date, then retreive those results. For this you dont necessarily need a conditional statement, you can just build your SQL query that includes a WHERE clause that includes today's date in the SQL statement. Again, without code, I'm just discussing over all concept.

should i script the website than when get stuck post the code on here?

Yes, since we are talking more than just HTML, seeing the actual PHP code that you get stuck on is pretty much needed. There are a lot of great PHP resources on this site that I'm sure would be willing to help.

thank you so much, i'm going to code the site up this weekend and i'll post back on this. i was hounding all over google to attempt to find some examples but i couldn't find any.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.