JayJabber Posted May 31, 2011 Share Posted May 31, 2011 Well this problem has occurred a lot. I try to put ". $_GET['site'] ." or ". $_POST['site'] ." in my script and i get a server errror when trying t access my page ( error connecting the page basically) Here is the part of the script which that is occuring to: if($_GET['step'] == 2) { echo 'Just adding INCLUDE files'; exec('xcopy /X/ / ". $_GET['site'] ." / /e/i', $a, $a1); <---- This line echo '<form action="install.php?step=3&guid='. $my_guid .'" method="post">'; echo '<input type="submit" value="Continue">'; echo '</form>'; } When i try using the $_GET function or $_POST functions in alot of stuff it just shows an server error(error connecting the page on my browser) Someone please help! Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/ Share on other sites More sharing options...
Kieran Menor Posted May 31, 2011 Share Posted May 31, 2011 It seems more likely that it's the exec() causing the problem, to be honest. Why would you need to copy files that way anyway? PHP has a copy() function. Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222765 Share on other sites More sharing options...
JayJabber Posted May 31, 2011 Author Share Posted May 31, 2011 I need to copy more than 1 file and i cannot find anything other than that. Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222773 Share on other sites More sharing options...
Kieran Menor Posted May 31, 2011 Share Posted May 31, 2011 A simple loop would be fine for the task. Something like: foreach(glob('folder/*.*') as $file) { copy($file, 'destination/'.basename($file)); } Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222774 Share on other sites More sharing options...
JayJabber Posted May 31, 2011 Author Share Posted May 31, 2011 I will try that out Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222784 Share on other sites More sharing options...
JayJabber Posted May 31, 2011 Author Share Posted May 31, 2011 where do i put what in where? Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222785 Share on other sites More sharing options...
Kieran Menor Posted May 31, 2011 Share Posted May 31, 2011 What exactly do you need to copy? Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222790 Share on other sites More sharing options...
JayJabber Posted May 31, 2011 Author Share Posted May 31, 2011 What exactly do you need to copy? A folder with PHP files and subfolders. Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222791 Share on other sites More sharing options...
Kieran Menor Posted May 31, 2011 Share Posted May 31, 2011 Ah. Well in that case, you will need something slightly more advanced. Try looking in the user comments on the copy page. I'm sure you can find a snippet that will help you. Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222796 Share on other sites More sharing options...
JayJabber Posted May 31, 2011 Author Share Posted May 31, 2011 Ah. Well in that case, you will need something slightly more advanced. Try looking in the user comments on the copy page. I'm sure you can find a snippet that will help you. Cannot find anything, Is there a way to copy files in a certain folder and you can repeat using that code? If you know what i mean if so then plz post it. Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222797 Share on other sites More sharing options...
Kieran Menor Posted May 31, 2011 Share Posted May 31, 2011 This function looks like a decent candidate. Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222801 Share on other sites More sharing options...
JayJabber Posted May 31, 2011 Author Share Posted May 31, 2011 This function looks like a decent candidate. How do i use it? what do i put in what? Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222807 Share on other sites More sharing options...
Kieran Menor Posted May 31, 2011 Share Posted May 31, 2011 Well put the function at the start of your script. Then you can call copy_r('foldertocopy', 'destination') at any time. Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222815 Share on other sites More sharing options...
JayJabber Posted May 31, 2011 Author Share Posted May 31, 2011 I tested and it didn't work! Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222830 Share on other sites More sharing options...
Ollifi Posted May 31, 2011 Share Posted May 31, 2011 Did it give any error? Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222834 Share on other sites More sharing options...
JayJabber Posted May 31, 2011 Author Share Posted May 31, 2011 No just didn't work Quote Link to comment https://forums.phpfreaks.com/topic/237969-big-problem-with-my-script/#findComment-1222843 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.