Jump to content
Killersites Community
Sign in to follow this  
Biske94

Isset function

Recommended Posts

Okay this is a newbie question but I know how it works but I just want to know how.

So this code for example:

if(isset($_POST['submit'])){

    // do some stuff

} else {

    // do some else stuff

}

This if statement will only do its code block if submit button is clicked or in nerds language if $_POST['submit'] is set.
So thats means that value of that submit button is NULL before clicking, but when we click that submit button we are giving it a value?

For example

<input type="submit" name="submit" value="someAwesomeValue">

if I click this button its value will be 'someAwesomeValue' which means I set $_POST['submit'] value to 'someAwesomeValue'

or in other words $_POST['submit'] = 'someAwesomeValue'

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×