fareedreg Posted January 1, 2010 Share Posted January 1, 2010 in my first.php I am having variable $chkmemid having value of database memid.. I would like to pass it to second.php.. how can i pass it and recieve it at other end? thanks in advance $memid = $row['mem_id']; $chkmemid=$memid; Link to comment https://forums.phpfreaks.com/topic/186839-how-to-pass-variable-values-in-php/ Share on other sites More sharing options...
ldb358 Posted January 1, 2010 Share Posted January 1, 2010 use a session $_SESSION['value'] = $valuetobepassed; //then to access it $passedvalue = $_SESSION['value']; Link to comment https://forums.phpfreaks.com/topic/186839-how-to-pass-variable-values-in-php/#findComment-986686 Share on other sites More sharing options...
oni-kun Posted January 1, 2010 Share Posted January 1, 2010 Yes, sessions are the simple way to go without $_GET/$_POST and is much more appropriate. Just note you'll have to put session_start(); on each page using sessions (first.php, second.php) Link to comment https://forums.phpfreaks.com/topic/186839-how-to-pass-variable-values-in-php/#findComment-986689 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.