I'm having a problem passing a variable from one PHP file to another PHP file. I'm trying to send the varialbe $insert to another PHP file that will just display it. For the life of me, I can't figure out why it won't work.
Any help would be great! Thanks.
1st PHP File (Sending $insert to $_SESSION['finalimage'])
<?php
session_start();
$insert = rand(5, 1500);
$_SESSION['finalimage'] = $insert;
header("Location: http://www.shmoggo.com/snapshot/snapshot_view.php");
echo base64_decode($_POST["image"]);
$final = base64_decode($_POST["image"]);
$newpath = "uploads/" . $insert . ".jpg";
file_put_contents($newpath, $final);
?>
2nd PHP File (Receiving $insert from $_SESSION['finalimage'])
<?php
session_start();
$insert = $_SESSION['finalimage'];
echo "Image Number = ". $insert;
?>