[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

How do I check to see if a value was posted from a form in PHP?

I'm new to PHP. I have a form with two drop down boxes. I need to check if the user has submitted the form by selecting one or both of the values so i can then use those values to query a database.

In ASP I would just check to see if the length of the request was greater than zero.
How do I do this in PHP?
0
Donnie Walker
Asked:
Donnie Walker
1 Solution
 
hieloCommented:
assuming your dropdown has name="state", you would use:
if( isset($_POST['state']) && !empty($_POST['state']) )
{
...
}
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now