DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   upload (http://www.daniweb.com/forums/thread153208.html)

queenc Oct 24th, 2008 12:59 am
upload
 
hi
i want to upload photos.
i have a upload button when the upload button is clicked a window will pop out and uploading image option are there.
when the close window buttton is clicked in the pop up,i want to close the pop up and the path should be displayed as a link in the parent window
this is my code.where uploading is working but i am not able to close the window when close button is clicked and dont know how to display the link in the parent page......

child window
 <?
      echo '<script language="javascript">';
      echo 'function updateparent(path,button) {';
      echo 'window.opener.document.stylist_reg_details.'.$_REQUEST['textbox'].".value=path;";
          echo 'var targ="link_'.$_REQUEST['textbox'].'";var obj_styphoto = window.opener.document.getElementById("targ");';
          echo 'alert ("Target = " + targ);';
          echo 'alert (obj_styphoto);';
          echo 'obj_styphoto.href=path; obj_styphoto.style.display = "block";';
      echo 'window.close();';
      echo '}</script>';
    ?>
parent window
workphoto1:<input type="text" readonly="readonly" name="workphoto1" class="story" size="35" />&nbsp;<INPUT type="button" value="Upload" onClick="alert('we support only JPG format');window.open('uploadpicture.php?stylistid=<?echo $stylistid;?>&textbox=workphoto1','mywindow','width=500,height=300')" />

queenc Oct 24th, 2008 1:00 am
Re: upload
 
child window
<form action="uploadpicture.php?stylistid=<?echo $_REQUEST['stylistid'];?>&textbox=<?echo $_REQUEST['textbox'];?>" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="stylistphoto" size="30">
<input type="submit" value="Upload!">
</form>

BrettH Oct 24th, 2008 8:28 pm
Re: upload
 
Quote:

when the close window buttton is clicked in the pop up,i want to close the pop up and the path should be displayed as a link in the parent window
What do you mean by "Path should be displayed as a link to the parent window" do you mean if you hover the mouse over the link that it shows the URL? That would be taken care of as a "title" tag in the anchor tag.


All times are GMT -4. The time now is 1:41 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC