hect1c_newbie Posted August 25, 2015 Share Posted August 25, 2015 Hi, I am new to creating and setting up websites so please. I have very limited knowledge in how websites utilise html, javascript, jquery and/or php together. However I do have some experience developing independent scripts in PHP. Currently I am working on a project that has the full LAMP stack setup. The webpage I am stuck on is file review and export page. I have a button with onclick option where I would like the user(once happy) to click go and files move from the web root location to an outbound folder outside of web root on the same server. These files are first placed in a folder inside the web root on button previously pressed which downloads a set of files from tables setup in mysql. Firstly I assuming this is common workflow and what I am trying to do makes practical sense. My questions are as follows: How can I direct the onclick button to perform the move of files? What is the best method to do this PHP, Javascript, Jquery? Thank you.Cheers Chris Quote Link to comment https://forums.phpfreaks.com/topic/297926-html-onclick-action-to-move-files/ Share on other sites More sharing options...
Psycho Posted August 25, 2015 Share Posted August 25, 2015 When you say "on click" that typically means using the onClick event in JavaScript. But, based on your explanation, it could just as easily be accomplished with a normal HTML form. But, those are just two methods to initiate the action (i.e. make a call to the server). So, you can either use a traditional HTML form or use an onClick event to make an AJAX call. I would suggest starting with an HTML form to get a working solution, then you can add an onClick event to initiate if you need to perform it without a page refresh. I assume you would have a form with all the relevant files listed and perhaps checkboxes to indicate which files to be moved. You would submit that form to the processing page (PHP) which would take the form data with the list of files and perform a move operation on them. However, allowing user input to be used to perform low level file operations can be risky. You will need to ensure that all input is validated and ensure no malicious references are sent from the user. That is a very high level generalization. If you want more specific help, you will need to provide the specific part that you are stuck on. Quote Link to comment https://forums.phpfreaks.com/topic/297926-html-onclick-action-to-move-files/#findComment-1519607 Share on other sites More sharing options...
RobertVecy Posted October 17, 2015 Share Posted October 17, 2015 but you need to take the screenshot in game, using the command. That will save an html screenshot in your user directory. Quote Link to comment https://forums.phpfreaks.com/topic/297926-html-onclick-action-to-move-files/#findComment-1523558 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.