Renegade605 Posted July 13, 2009 Share Posted July 13, 2009 I have recently decided that PHP would be the best way of achieving an effect with a Call of Duty 4 server I am running.I want to have my server run a random map and gametype rotation. What I need is for the server to call on (example) randommap.php and that php file would return the commands necessary to change the map.My question is, how do I get the php to actually run? When I try to call on randommap.php, the code is not parsed before being passed to the server. (Which causes an error, because "<?php" is not a command in CoD4.) Link to comment Share on other sites More sharing options...
justsomeguy Posted July 13, 2009 Share Posted July 13, 2009 There is a command-line version of PHP you can use to execute PHP code. If the server can only read from a file, it's not going to work. If you can give it a command to run, you can tell it to execute PHP and give it the filename of the script to run. Link to comment Share on other sites More sharing options...
Renegade605 Posted July 13, 2009 Author Share Posted July 13, 2009 So the command-line would parse the code and output it to another file, which I could then execute with the CoD4 server? How do I access the command-line?I'm running PHP 5.2.6 and I installed it as part of XAMPP 1.6.7 Link to comment Share on other sites More sharing options...
justsomeguy Posted July 13, 2009 Share Posted July 13, 2009 Well, it's going to execute the code. If you have PHP code that writes to a file, then a file will be written. You can probably also redirect the output to a text file. Check here for details:http://www.php.net/manual/en/features.commandline.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.