This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Transfer Learning for Natural Language Processing (MEAP) and have Paul Azunre on-line!
See this thread for details.
Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Stop user to submit form untill the time on string(URL) expired with PHP?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i limit the user to submit the form once in 24 hour in php. No Logins required for submit the form. Is there any way to set the timer on a specific string ? Any help appreciate .?

Simple submit form for URL using POST method and for validation and checks i used simple "empty" & "preg_match" variables works fine.

I want the user to submit the URL form once in 24 hour. For that, How to set the timer on a string or how to force the user to submit same url until your time expired .? This should be done in php not in Javascript. Any Idea which function or variable and how to use ?
 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch linnea.

I think that adding to the URL for the POST method may not be enough for the extra work that you add to the system.
I would hazard a guess that you are planning on capturing the IP address of the end user, however that same end user may get a different simply by disconnecting and reconnecting to the Internet.
Plus, some uses may visit the site in question with multiple devices during different times of the day.

What you could try is to capture the end user's email address (or something uniquely identifiable) and before allowing the values to be submitted to the database you check to see if that value was used in the last 24 hours.
Without capturing an email address (or something uniquely identifiable)  and without forcing the user to login I think a cookie would be the next best option.
 
Evacuate the building! Here, take this tiny ad with you:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic