physaux Posted October 16, 2009 Share Posted October 16, 2009 Hey guys, i have a main file, index.php i also have a file called captchaimage.php I have used it before, so i know everything works and all. I am making a quick new php functionality, and i need to send data from index.php to captchaimage.php. I was just wondering if i am missing anything? Here is my code: <?php session_start(); //... $_SESSION["OrderOfOperations"]=$OrderOfOperations; echo '<img src="captchaimage.php />'; //... session_destroy(); ?> And in my captchaimage.php file, <?php session_start(); $OrderOfOperations = $_SESSION["OrderOfOperations"]; if(isset($OrderOfOperations)){ print_r($OrderOfOperations);// idk why i did this, can't see print anyways lol } //... session_destroy();// DO I need this here? ?> So is that everything i need? and do i/ should i destroy the session in the second file? Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/177930-solved-usine-session-to-transfer-a-variable-short-question/ Share on other sites More sharing options...
mikesta707 Posted October 16, 2009 Share Posted October 16, 2009 session_destroy simply destroys all data that is registered to your sessions. If that is your intent, than you need it there. If not, then you don't. Beyond that, the script looks fine Quote Link to comment https://forums.phpfreaks.com/topic/177930-solved-usine-session-to-transfer-a-variable-short-question/#findComment-938131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.