debz89uk Posted March 24, 2010 Share Posted March 24, 2010 I have a index.php page which displays a different output depending on whether information is uploaded (from a file php-mysql table) or whether is it entered through a form. Right now I am using sessions to pass these variables. E.g. when a file is uploaded i am using a hidden field to change the variable to "upload" then when the upload.php redirects back to the index it shows the output of this (instead of the output if would have if it was entered by the form) and the same for the form. This all works fine right now, however, because I am also using the session for a login, the variables are unset after the browser is closed, so that my index displays a blank page. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/196387-variables/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 24, 2010 Share Posted March 24, 2010 You need to set up a default value when the page is visited and there is no session variable set. Link to comment https://forums.phpfreaks.com/topic/196387-variables/#findComment-1031121 Share on other sites More sharing options...
debz89uk Posted March 24, 2010 Author Share Posted March 24, 2010 But there are two values that the variable can be on the index page, so I don't want it to be set to something when the page is refreshed and then one will display even if its not the correct one? Link to comment https://forums.phpfreaks.com/topic/196387-variables/#findComment-1031138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.