Wait for input

  • natas
  • PHP Ninja
  • Proficient
  • natas
  • Posts: 308
  • Loc: AFK

Post 3+ Months Ago

Is there a function in PHP that will allow a script to wait for user input before continuing the script.

The problem I have is that if a user inputs a value and that value exists already in the database, they will have the option to either overwrite the existing field or enter a new value.

I know I can do this with a form, but just curious as to if I can do it another way.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

You might be able to do it with ajax, but not really sure.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

You can not interrupt a request / response iteration with sub-queries and continue the previous request / response after the sub-query. Any interruption will scrap the current transaction.

--

When you see things like "Check if this username exists" in user registration forms, they're using AJAX like spoof mentioned to ask the server if the name exists.

Could something like that work for you ? A button that the user can click to see if the value exists ?

There could also be a checkbox to signal the overwrite.
  • natas
  • PHP Ninja
  • Proficient
  • natas
  • Posts: 308
  • Loc: AFK

Post 3+ Months Ago

Thanks! I will definitely look into AJAX.
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

If you're not sure where to start, maybe having a look at jQuery won't hurt. Using jQuery's ajax is pretty simple.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 103 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.