clamum
Lifer
See my code below. The part that's stumping me is why the
echo "session: " . $_SESSION["photo$cntn"] . ", " . $_SESSION["photo$cntu"] . "<br />";
line prints out the same name for both session variables. It's as if $_SESSION["photo$cntn"] was replaced with $_SESSION["photo$cntu"] in that line.
What's weird is that
echo $name . "<br />";
$_SESSION["photo$cntn"] = $name;
echo $unique_name . "<br />";
$_SESSION["photo$cntu"] = $unique_name;
Prints out correctly, i.e., the $_SESSION["photo$cntn"] and $_SESSION["photo$cntu"] are different like they should be. I'm trying to save the original filename and a uniquely generated (using the md5(uniqid(time())) function) filename in session variables and this has got me stumped. I must be missing something obvious but I don't know what it is. Any help would be appreciated.
Here's what gets printed out:
picturefile.jpg
9255247715adb28aa9970e5de9d61f63.jpg
session: 9255247715adb28aa9970e5de9d61f63.jpg, 9255247715adb28aa9970e5de9d61f63.jpg
echo "session: " . $_SESSION["photo$cntn"] . ", " . $_SESSION["photo$cntu"] . "<br />";
line prints out the same name for both session variables. It's as if $_SESSION["photo$cntn"] was replaced with $_SESSION["photo$cntu"] in that line.
What's weird is that
echo $name . "<br />";
$_SESSION["photo$cntn"] = $name;
echo $unique_name . "<br />";
$_SESSION["photo$cntu"] = $unique_name;
Prints out correctly, i.e., the $_SESSION["photo$cntn"] and $_SESSION["photo$cntu"] are different like they should be. I'm trying to save the original filename and a uniquely generated (using the md5(uniqid(time())) function) filename in session variables and this has got me stumped. I must be missing something obvious but I don't know what it is. Any help would be appreciated.
Here's what gets printed out:
picturefile.jpg
9255247715adb28aa9970e5de9d61f63.jpg
session: 9255247715adb28aa9970e5de9d61f63.jpg, 9255247715adb28aa9970e5de9d61f63.jpg