10.08.2014, 06:38
Hello,
I am trying to make 'Start' image to start my sa-mp hosted server, but instead of doing the linux command it sends me to "loginfail.php" page. Here is the code:
I repeat, it sends me to "loginfail.php" when I click the "Start" image.
I would like to have some help here ><
I am trying to make 'Start' image to start my sa-mp hosted server, but instead of doing the linux command it sends me to "loginfail.php" page. Here is the code:
PHP код:
<body>
<?php
include("connect.php");
include('Net/SSH2.php');
*** CONNECTION TO DATABASE MYSQL CODE ***
if(mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result))
{
$_SESSION['logged'] = true;
$ssh = new Net_SSH2('xx.xx.xx.xx');
if (!$ssh->login($info['username'], $info['password']))
{
exit('Connection to Linux has failed, please try again.');
}
echo '<form action="" method="GET">';
echo '<input type="image" src="start.png" width=100 height=100 name="start" />';
echo '</form>';
if(isset($_GET['start']))
{
echo $ssh->setTimeout(5);
echo $ssh->exec('(cd '.$info['username'].' ; nohup ./samp03svr &)');
}
}
}
else
{
$_SESSION['logged'] = null;
header("Location: loginfail.php");
}
?>
</body>
I would like to have some help here ><