html - Handling post and session values in form submit PHP -
i have code this. i'm trying is:
- check whether post values there, if yes - execute query , display result.
- 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
Post a Comment