Machine Posted March 9, 2013 Share Posted March 9, 2013 hello well im making site to control my server but the problem is im using php so what is the code to start mtasa server using php programming pls help me Link to comment
iPrestege Posted March 9, 2013 Share Posted March 9, 2013 fetchRemote Maybe ?? This function allows you to post and receive data from HTTP servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the download completes. In the case when the call fails, a string containing "ERROR" followed by an integer containing the error reason will be passed to the callback function. The reason for failure will be similar to errors found with websites - file not found, server not found and timeouts. If you are using fetchRemote to connect to a PHP script, you can use file_get_contents("php://input") to read the postData sent from this function. Link to comment
Micro Posted March 9, 2013 Share Posted March 9, 2013 not this code he mean he need programing control panel but he need code for start mtasa on php Link to comment
Castillo Posted March 9, 2013 Share Posted March 9, 2013 If it's impossible, mind explaining how all the game hosting companys work? because most of them got a control panel to restart/stop/start the server. @Machine, Micro: I don't know anything about this I'm afraid. Link to comment
Micro Posted March 9, 2013 Share Posted March 9, 2013 loooooooooooooool , man u see easy admin panel , or gamecp???????????????????? Link to comment
Micro Posted March 9, 2013 Share Posted March 9, 2013 <?php exec('nohup ./mta-server') ; ?> what the error in this code? Link to comment
Jaysds1 Posted March 9, 2013 Share Posted March 9, 2013 If you want to start/stop/restart your server, you would need to put your server on a vps, it would not be able to start/stop/restart on anything else other than a vps or your computer. Link to comment
OGF Posted March 9, 2013 Share Posted March 9, 2013 Make no sense. Since you think it's impossible then you have no business here. Link to comment
iPrestege Posted March 9, 2013 Share Posted March 9, 2013 Make no sense. Since you think it's impossible then you have no business here. Yes why? becuase his code make no sense in Lua PG. Link to comment
Jaysds1 Posted March 9, 2013 Share Posted March 9, 2013 (edited) Make no sense. Since you think it's impossible then you have no business here. Yes why? becuase his code make no sense in Lua PG. ummm, actually, that's php programming(website programming) Edited March 9, 2013 by Guest Link to comment
Castillo Posted March 9, 2013 Share Posted March 9, 2013 Topic moved out of scripting section, since that section is meant for Lua scripting help. Link to comment
Anderl Posted March 9, 2013 Share Posted March 9, 2013 @Mr.Pres[T]ege, no, that has nothing to do with what he wants / No, it isn't impossible. / His code DOES makes sense, it's PHP. @Micro, is the page running in the same folder as the server? @Jaysds1, PHP isn't for website design. Link to comment
Micro Posted March 9, 2013 Share Posted March 9, 2013 yes iam upload it in this source red.fpsserver.com/mta but still not work Link to comment
Jaysds1 Posted March 9, 2013 Share Posted March 9, 2013 Are you running your site on a vps? Link to comment
Anderl Posted March 9, 2013 Share Posted March 9, 2013 Are you running your site on a vps? What does that has to do? @Micro, I've never used exec function so I can't help you much but are you sure the PHP page is being executed? Try outputting something when the page loads with "echo". Link to comment
Micro Posted March 12, 2013 Share Posted March 12, 2013 all this codes not workin <?php if ($_REQUEST['soft']=='toto') shell.exec("./mta-server --ip %IP% --port %PORT%"); shell.exec("nohup ./mta-server --ip %IP% --port %PORT%"); shell.exec("sudo nohup ./mta-server --ip %IP% --port %PORT%"); exec("sudo nohup ./mta-server"); ?> Link to comment
Anderl Posted March 12, 2013 Share Posted March 12, 2013 There is no such "shell.exec" function in PHP AFAIK. Also, are you sure you're sending the data 'soft' with value 'toto'? The page URL would be something like this: "http://www.mypage.com/index.php?soft=toto". Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now