I am writing a powershell script that automates the setup of Wordpress. This script will be used by multiple people when creating their sites, and id like to add a bit of extra functionality.
I would like to have my peers access a php page which would allow for them to pick and choose themes and plugins for their page, and then pass their choices (I assumed its easiest through an array) to my powershell scripts. The reason the powershell script must handle this is because after they have picked their files, the powershell script can connect to an internal server and handle the rest.
I guess my question comes in two parts; first being is the above even possible? and if so does it seem like a logical way to handle this problem?
Second would be how to actually achieve this? Below is my php/html code to handle the download page which will hopefully be able to pass an array to my script. (The code below downloads from a 'temp' site for testing purposes and does not really meet my requirements)
<?php
$val=$_POST['theme'];
if($val == 'aa') {
header('Content-disposition: attachment; filename=all-in-one-slideshow.zip');
header('Content-type: application/zip');
$url = 'http://mypage.com/wordpressFiles/all-in-one-slideshow.zip';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $path);
$data = curl_exec($ch);
curl_close($ch);
fclose($fp);
} else if($val == 'bb') {
} else {
}
?>
<form action="download.php" method="post">
<select name="theme" id="theme" class="select-list">
<option value="\">Choose A Theme</option>
<option value="aa">All-In-One-Slideshow</br>
<option value="bb">BB</br>
</select>
<input type="submit" value="Download" />
</form>
Thank you in advance for any help.