Jump to content

Aimless

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Posts posted by Aimless

  1. Hey there,

     

    I'm calculating the current date like so

    $currentdate = date('d-m-Y', strtotime('+0 days'));

     

    So let's say a MYSQL field has a date of : 25-04-2011 in the format d-m-Y, and I want to return all of the rows that have a date that is -100 to +10 days compared to $currentdate, how do I do this?

     

    Any help is much appreciated.

     

    Best Regards,

    Aimless

  2. Hi,

     

    I'm trying to create a dropdown box that is filled by a mysql column. I found this example, which fills the dropdown box with a list of columns in the database, but I want to fill the drop down box with the content in a column.

    Any guidance on how to do this would be appreciated.

     

    Thank you!

     

    Example:

    $connection = mysql_connect("localhost","username","password"); 
    $fields = mysql_list_fields("database", "table", $connection); 
    $columns = mysql_num_fields($fields); 
    echo "<form action=page_to_post_to.php method=POST><select name=Field>"; 
    for ($i = 0; $i < $columns; $i++) { 
    echo "<option value=$i>"; 
    echo mysql_field_name($fields, $i); 
    } 
    echo "</select></form>"; 
    

  3. This may not be appropriate but I haven't had any luck with what you guys have kindly suggested, so if anyone can make those three little segments of code in the original post I will PayPal them $3 as thanks, please PM or MSN me(trunetworkenquiries@gmail.com) if you can do it.

  4. Hi,

     

    Thanks but no luck.

    	public function Start()
    {
    	require('auth.php');
    	require('GetServer.php');
    	//$this->Run('start /D "'.GAME_DIRECTORY.'" /B '.GAME_BIN_NAME);
            popen("/samp/samp", "r");
    
    
    //	return true;
    }

    popen("/samp/samp", "r");

    It's not doing anything!

     

    Can someone tell me how to start an application in linux, my application is located at /samp/samp, an example on how to start it will do

  5. Can someone please tell me what this code:

    	private function Run($sCommand)
    {
    	require('auth.php');
    	require('GetServer.php');
    	$sCommand = 'cmd /C '.$sCommand;
    	$oShell = new COM("WScript.Shell");
    	$oShell->Run($sCommand, 0, false);
    	return true;
    }
    public function Start()
    {
    	require('auth.php');
    	require('GetServer.php');
    	$this->Run('start /D "'.GAME_DIRECTORY.'" /B '.GAME_BIN_NAME);
    	return true;
    }
    public function Stop()
    {
    	require('auth.php');
    	require('GetServer.php');
    	$this->Run('taskkill /F /IM '.GAME_BIN_NAME.' /T');
    	return true;
    }

    would be for Linux, this is working fine to Start and Stop applications on Windows but of course not for Linux as I need to change some of the code, but I'm not sure what to change.

     

    All help very much appreciated.

  6. Why you have kept the "." around GAME_DIRECTORY?

     

    you have defined the constant like - define("GAME_DIRECTORY", $row['path']);

     

    then use as below

     

    $ft["settings"]["DIR"]              = GAME_DIRECTORY ;

     

    Let us know what error you are facing?

     

    Thanks

     

    Of course, thank you!

  7. What's wrong with:

    $ft["settings"]["DIR"]              = .GAME_DIRECTORY. ;

     

    .GAME_DIRECTORY. has previously been defined as:

    define("GAME_DIRECTORY", $row['path']);

     

    Thanks,

  8. Doesn't seem to be working

    INSERT INTO members(firstname, lastname, login, passwd, path, bin, server, port, srv, due, payment, ftp, admin) VALUES('$fname','$lname','$login','".md5($_POST['password'])."','$path','$bin','$server','$port','$srv','$due','$payment','$ftp','$admin')";

  9. Hey,

     

    I'm trying to start an application, here's what I've got so far:

    		$WshShell = new COM("WScript.Shell");
    $oExec = $WshShell->Run("cd ".GAME_DIRECTORY." ; nohup ./".GAME_BIN_NAME." &", 0, $m);

     

    When I execute this code nothing happens, it doesn't seem to be starting the application.

     

    Can anyone tell me how to start my application, I first need to CD to .GAME_DIRECTORY. and then run .GAME_BIN_NAME.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.