Jump to content

[SOLVED] Usine SESSION to transfer a variable; short question


physaux

Recommended Posts

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!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.