PHP if else with database -
i'm having trouble php file. i've done connection database can check it.
i've got if-else statement in case return of database wanted. thing everytime reload url, echo in else statement, instead of nothing. dont want if-else execute until submit html form i've got.
here simple example:
if($somethingtocheck){ echo 'hey!'; }else{ echo 'bad!'; }
the var $somethingtocheck declared , know right.
so explained, if reload url, string bad! in screen, if have not submited form.
there's way not execute if-else statement until submit html form?
edit: more details problem.
you should enclose in block runned when answering post:
if ($_server['request_method'] === 'post') { if($somethingtocheck){ echo 'hey!'; }else{ echo 'bad!'; } }
Comments
Post a Comment