php - I have trouble with my SESSION that change when i insert somethnig with POST -
i have trouble code below, put $level
in $_session
, don't know how that. $level
replace user $_session['level']
, logged out.
<?php session_start(); if( $_post['action'] == 'add' ) { $level = $_post['level']; ?> <form action="<?php $_server[php_self]; ?>" method="post" > <input type="text" name="level" value="" placeholder="level" /><br /> <input type="hidden" name="action" value="add" /> <input type="submit" value="add user" /> </form>
i'd common issue session variable forgetting session_start()
in top of document. have put session_start()
belongs, but have forgotten define session variable :)
this how it's done.
$_session['level'] = $_post['level'];
Comments
Post a Comment