Chrisj Posted October 9, 2014 Share Posted October 9, 2014 In an Upload Form that I'm using, it has this line: $newfilename = $SESSION['userid'].$_FILES["file"]["name"]; I need to "store the newfilename in a session variable" (in another php file) and use the session variable in this link, instead of newfilename: <a href="upload/<?php echo $newfilename?>"><?php echo $newfilename?></a> So, would this be correct? $newfilename = $_SESSION['newfilename'].$_FILES["newfilename"]; Quote Link to comment https://forums.phpfreaks.com/topic/291524-new-file-name-in-a-session-variable-is-this-correct/ Share on other sites More sharing options...
sKunKbad Posted October 9, 2014 Share Posted October 9, 2014 No, because the new file name is already a concatenation of the user ID and the file name, so you would simply set the new session variable like this: $_SESSION['newfilename'] = $newfilename; Quote Link to comment https://forums.phpfreaks.com/topic/291524-new-file-name-in-a-session-variable-is-this-correct/#findComment-1493112 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.