is there a way for me, in a .php page when loaded, to make it run a .bat file on the server? hope you understand...
thanks for your help!
php and .bat
Moderator: General Moderators
- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
ok, thanks
would i be able to put a path to a .bat file in the $command vairable? I tried but it just gives a blank page?
thanks
Code: Select all
system($command[$return_var]);thanks
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
The backtick operator is a nicer way of saying system()Be very careful with variables in the command line because if the user can control them in anyway i.e. via $_GET, $_POST or indirectly via a database then they might be able to run nasty commands.
Code: Select all
$var = 'foo'; echo `C:\whatever\someFile.bat cmd line args $var`;- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA