html - Handling post and session values in form submit PHP -


i have code this. i'm trying is:

  1. check whether post values there, if yes - execute query , display result.
  2. or check session value, if session there play session value , display result.

when print session value, getting printed (i.e author_id there in session) not coming inside if loop. why?

in other words, want check post values or session value, , display record accordingly.

ps: if remove || condition (i.e isset ( $_session ['author_id'] ) ) code words perfect.

    <?php      session_start();     print_r($_session);     if (isset ( $_post ['submit'] )  ||  isset ( $_session ['author_id'] )) {             .. post values or session values ..      }     ?>      <form method="post" id="myform1" name="myform1">     ........... form fields..............     <input type="submit" name="submit" value="submit" />     </form> 

important: instead of using session or cookie, there way handle form input field values in same page?

try check $_post

if (isset( $_post)||isset ( $_session ['author_id'] )) {             .. post values or session values ..      } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -