jdh23 Posted September 4, 2007 Share Posted September 4, 2007 Hello, I am trying to store the url of some html files on the server into a MySQL table. I am able to do this by using the html <input type = file ... > clicking the BROWSE button and cutting and pasting the location into a text field which gets saved when I press the SUBMIT button. eg. after clicking BROWSE and selecting the file the text field beside the BROWSE button displays [/opt/lampp/htdocs/myfiles/myfile.html] which I cut and paste into the other text field as [../myfiles/myfile.html]. This cutting and pasting is tiresome and clunky and obviously lousy programming. I would like to automate the process so that after pressing BROWSE the other text field would be automatically filled. I figure that I probably need to use the $_FILES super global but I'm not sure how to do this or even if using the super global is the right approach. Any help would be most appreciated. --John Link to comment https://forums.phpfreaks.com/topic/67926-storing-file-location-in-mysql/ Share on other sites More sharing options...
lemmin Posted September 4, 2007 Share Posted September 4, 2007 You can do that with a little javascript: <input onpropertychange="thetext.value=this.value" type=file name="thefile"> <input id="thetext" type=text name="thetext"> Link to comment https://forums.phpfreaks.com/topic/67926-storing-file-location-in-mysql/#findComment-341419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.