php : action on form's not working- beginner -


i'm beginner php, have small problem doing action when submitting form

the form that

<form name="form1" method="post" action="?flag=1">    <input type="submit" name="button" id="button" value="submit"> </form> 

and php code - on same page-

<?php  if ($flag) {echo "helllllllllo";} ?> 

and didn't work, tried make action on other page action="otherpage.php?flag=1"

but didn't work pls :) ?

$_get variables - variables see in query string

$_post variables - variables send form if method="post"

if need check if flag exists do:

if(isset($_get['flag'])){ 

without isset can undefined index notice


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -