isaac_cm Posted August 5, 2007 Share Posted August 5, 2007 Hello, I know how to pass information between pages using cookies, sessions, form variables , but I wonder how to pass a variable to already opened paged ? I have a pages contain an image button that button will open a window to upload file into server I need when the window closed to pass the images name to the opened (calling) pages any Advice ? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/63408-passing-variable-between-a-window-and-an-open-page/ Share on other sites More sharing options...
Fadion Posted August 5, 2007 Share Posted August 5, 2007 U can use sessions. After u make the validation and move_uploaded_file() assign the filename to a session. Quote Link to comment https://forums.phpfreaks.com/topic/63408-passing-variable-between-a-window-and-an-open-page/#findComment-316082 Share on other sites More sharing options...
isaac_cm Posted August 5, 2007 Author Share Posted August 5, 2007 I need after closing the window the file name displayed in a text box how I can detect window close ? thanks Quote Link to comment https://forums.phpfreaks.com/topic/63408-passing-variable-between-a-window-and-an-open-page/#findComment-316102 Share on other sites More sharing options...
BlueSkyIS Posted August 5, 2007 Share Posted August 5, 2007 Javascript. You could add an onClose() event to the window to send a value to the window's opener. not php.... Quote Link to comment https://forums.phpfreaks.com/topic/63408-passing-variable-between-a-window-and-an-open-page/#findComment-316106 Share on other sites More sharing options...
isaac_cm Posted August 5, 2007 Author Share Posted August 5, 2007 Thanks, found some script I will try them Quote Link to comment https://forums.phpfreaks.com/topic/63408-passing-variable-between-a-window-and-an-open-page/#findComment-316163 Share on other sites More sharing options...
isaac_cm Posted August 5, 2007 Author Share Posted August 5, 2007 no luck to find a script do what I want , I tried addEventListener and window.onclose = closedWin; but nothing work any help ? thanks Quote Link to comment https://forums.phpfreaks.com/topic/63408-passing-variable-between-a-window-and-an-open-page/#findComment-316192 Share on other sites More sharing options...
Fadion Posted August 5, 2007 Share Posted August 5, 2007 But why stressing yourself with javascript and such. When the image or images are uploaded pass their filename to sessions and u have got those values, before and after the user closes the window. If there is any specific reason for this, let us know more. Quote Link to comment https://forums.phpfreaks.com/topic/63408-passing-variable-between-a-window-and-an-open-page/#findComment-316243 Share on other sites More sharing options...
isaac_cm Posted August 6, 2007 Author Share Posted August 6, 2007 no reason but if I used session do I have to use something like timer to check session value ? I mean what trigger I use to know that the file is uploaded ? I dont want to use ajax my host is slow thanks Quote Link to comment https://forums.phpfreaks.com/topic/63408-passing-variable-between-a-window-and-an-open-page/#findComment-316643 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.