Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,162,790 members, 7,851,669 topics. Date: Thursday, 06 June 2024 at 04:57 AM

How can I do this in php? - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How can I do this in php? (579 Views)

A Beginners Guide To Object-oriented Programming (OOP) In PHP 5+ / Ecommerce Web Application Written From Scratch In Php For Sale With Mobile View / What's The Difference Between "require Once" And "include" In Php? (2) (3) (4)

(1) (Reply) (Go Down)

How can I do this in php? by chrishenzo: 7:56am On Dec 12, 2010
I have six options(boy,girl,guy,lady,man,woman) in a form. I want when an option e.g "guy" is selected and submited, it won't be available again. It can only become available after seven days.

Secondly when an option is submitted, it will have icon or mark that indicates that it has already been selected or it will become invisible to guests or users. But after seven days, it will become visible or the icon/mark will disappear from it.
Re: How can I do this in php? by yawatide(f): 12:44pm On Dec 12, 2010
IMHO, if you want it to disappear, your second paragraph makes no sense. Also, do you want the selection unavailable to the the 2nd and subsequent visitors to the site or to only one person (in other words, it is user specific)?

You probably want to have a database set up with at least 2 columns - selection and date selected. Then when the choice is made and "submit" is clicked, you store the selection with the date selected. Then each time the person logs in, you query the database for the selection and calculate the number of days. If greater than 7, you display. It probably wouldn't hurt displaying some kind of text on the page informing them that any selection made won't be available for 7 days (why you want to do this still beats me though).

Good luck and happy coding!
Re: How can I do this in php? by chrishenzo: 3:36pm On Dec 12, 2010
yawa-ti-de:

IMHO, if you want it to disappear, your second paragraph makes no sense.  Also, do you want the selection unavailable to the the 2nd and subsequent visitors to the site or to only one person (in other words, it is user specific)?

You probably want to have a database set up with at least 2 columns - selection and date selected.  Then when the choice is made and "submit" is clicked, you store the selection with the date selected.   Then each time the person logs in, you query the database for the selection and calculate the number of days.  If greater than 7, you display.  It probably wouldn't hurt displaying some kind of text on the page informing them that any selection made won't be available for 7 days (why you want to do this still beats me though).

Good luck and happy coding!

Thank you for your contribution. You can call it user specific i.e no other user can select the same option until the days expire that is the seven days.

It is like choosing a username in any website whereby the username name cannot be assign to two people at the same time. I'm thinking of distroying the database every seven days. I still need a way to make the option invisible or have a sign name "already selected"
Re: How can I do this in php? by yawatide(f): 10:03pm On Dec 12, 2010
You can use javascriptcss for that (display: none, font color grey, etc)

(1) (Reply)

Result Updates From Henfextech Presidential Election / Frontpage Server Extension Error: / Mielno

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.