javadyousefi Posted July 17, 2011 Share Posted July 17, 2011 I have an image in the main.php file : <img src="..\images\image.gif" class="cur" onclick="imgWin();"> when I click on this image below function has called : function imgWin(){ imageWin=window.open("../pages/img.php","imageWin","toolbar=no,width=500,height=200,directories=no,menubar=no,SCROLLBARS=yes");} this function opens img.php in a new windowimg.php file : <HTML><HEAD> <TITLE>upload image</TITLE></HEAD><BODY> <FORM NAME="imgForm" method="get" action="#"> address : <INPUT type="file" name="imgUrl" size="50"> description : <INPUT type="text" name="description" size="50"> <input type="submit" value="sumbit"> </form></BODY></HTML> I want to when I click on submit button in above form , data from imgUrl and description textboxes send to main.php file.How to I can do it ?Please help me about this problem Link to comment Share on other sites More sharing options...
Gex Posted July 17, 2011 Share Posted July 17, 2011 You could try setting the action parameter of your form tag to main.php, see if that does the trick? Link to comment Share on other sites More sharing options...
jeffman Posted July 17, 2011 Share Posted July 17, 2011 send data from a new window to previous window in phpI'm not entirely sure if this answers your question.The web uses a client-request model of communication. PHP can communicate with your first window only when the first window sends a request to your server. There is no way for PHP to send information to the first window in response to a request made by the second window. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 18, 2011 Share Posted July 18, 2011 You can use Javascript to refresh the parent window after the form gets submitted. Link to comment Share on other sites More sharing options...
jeffman Posted July 18, 2011 Share Posted July 18, 2011 @JSG: Race condition? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 18, 2011 Share Posted July 18, 2011 The form would need to be submitted and reloaded, and the HTML after the submission would need to send the commands to the parent window. I did something similar where I had a popup window for uploading files, and when the form was submitted successfully it just printed out a little bit of Javascript to run some functions on the parent window, and then close the popup. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.