regoch Posted December 20, 2011 Share Posted December 20, 2011 I was wondering if there is any way to let visitor chose image background of div and store it in session so every page have same background? Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/ Share on other sites More sharing options...
dzelenika Posted December 20, 2011 Share Posted December 20, 2011 You shuld save only name of image in session Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299642 Share on other sites More sharing options...
regoch Posted December 20, 2011 Author Share Posted December 20, 2011 and how to put it in? by javascript? Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299647 Share on other sites More sharing options...
SergeiSS Posted December 20, 2011 Share Posted December 20, 2011 You'd better say the aim of this action. Maybe it's better to use CSS for it. Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299655 Share on other sites More sharing options...
Ivan Ivković Posted December 20, 2011 Share Posted December 20, 2011 Pass the image name with AJAX to a PHP file, then reload the background image with javascript. Just one method out of possible tons of them. Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299660 Share on other sites More sharing options...
dzelenika Posted December 20, 2011 Share Posted December 20, 2011 Rather create two diferent css files and store css fiolename in session variable Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299669 Share on other sites More sharing options...
regoch Posted December 20, 2011 Author Share Posted December 20, 2011 something like language changing script? have different file for different language and change it via session? Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299727 Share on other sites More sharing options...
SergeiSS Posted December 20, 2011 Share Posted December 20, 2011 something like language changing script? have different file for different language and change it via session? Yes, approximately the same. Logic is simple. When you are creating page, you tell the name of CSS file to use. If you keep in session a name of non-default file, just tell this name. Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299732 Share on other sites More sharing options...
regoch Posted December 20, 2011 Author Share Posted December 20, 2011 Gonna try! thanks to all! I try to find a tutorial online but, nothing! Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299848 Share on other sites More sharing options...
regoch Posted December 20, 2011 Author Share Posted December 20, 2011 Will this session have conflict with my language session? Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299887 Share on other sites More sharing options...
dzelenika Posted December 20, 2011 Share Posted December 20, 2011 there should exists two different session variables, one for language and other for selected css Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299911 Share on other sites More sharing options...
regoch Posted December 20, 2011 Author Share Posted December 20, 2011 You can write post about it on your blog, ! Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299924 Share on other sites More sharing options...
dzelenika Posted December 21, 2011 Share Posted December 21, 2011 I will, next week. thanks for the idea. Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1299962 Share on other sites More sharing options...
SergeiSS Posted December 21, 2011 Share Posted December 21, 2011 Will this session have conflict with my language session? This question show that you don't understand session. I'll explain in short. Session use the file for every user that have a session. These files are stored at the server. The storage duration could be changed. In such a file some variables are stored. When user is connected and he has a session (session ID is stored in the cookie at client side), then server look for his own file. If this file is found then server knows all session variables for this user. It means that you have one session only but a lot of session variables that could be used for different purposes. Link to comment https://forums.phpfreaks.com/topic/253531-background-image-store-in-sesion/#findComment-1300001 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.