jat0369
asked on
PHP to Powershell Execution
Hello everyone. I'm having some troubles figuring out how to wrap my head around this project I'm working on. I want to have a webpage function as my script's gui.
Basically I want to have a simple PHP form that will pass the text box values to powershell variables.
Name :________
Email: _________
Write-Host $Name
Write-Host $Email
How would I go about doing that? I'm a novice to both PHP and powershell.
Basically I want to have a simple PHP form that will pass the text box values to powershell variables.
Name :________
Email: _________
Write-Host $Name
Write-Host $Email
How would I go about doing that? I'm a novice to both PHP and powershell.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just a thought... If you're new to PHP, try to explain in writing (one sentence is all you need) what each line of code in the accepted solution is doing. If you find that you can't do that, you might want to take some time to look up the functions, learn about regular expressions, etc. If you're in an area of PHP programming where exec() seems like the answer, you're almost always asking the wrong question. It's a place where many risks lie, and many hosting companies disable exec() for that reason.
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html
PHP has an introductory tutorial on dealing with HTML forms. When you read it, follow the links for more details about how to work with forms safely.
http://php.net/manual/en/tutorial.forms.php
I'll leave the PowerShell part to another expert.