Jump to content

dabip

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dabip's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Just a small bump. Noticed this was starting to fall down
  2. Hmm that didn't seem to do anything either. I'm really thinking taht it's simply the process, and not our code. I even tried running a remote script on in the path of the ./mta_server file itself. <?php echo run_in_background( "./mta_server" ); $fh = fopen( 'test.txt', 'w' ); fwrite( $fh, 'Hi' ); fclose( $fh ); function run_in_background($Command, $Priority = 0) { if($Priority) $PID = shell_exec("nohup nice -n $Priority $Command 2> /dev/null & ech$ else $PID = shell_exec("nohup $Command 2> /dev/null & echo $!"); return($PID); } ?> It still failed to run into the background. :\ (I found that function on some website). It still wrote a file btw. So it was functioning correctly :\
  3. Hello, I'm trying to SSH into a remote Debian Linux Server, and run a server. The server download is at: http://download.mtasa.com/deathmatch.html in case you wanted to test it out Anyway, here is the code I'm using: My SSH Class built on top of SSH2 http://dabphp.pastebin.com/m1c5563 My Code utilizing it... http://dabphp.pastebin.com/m2c0acf34 I have tried using nohup, and ./mta_server & and other things through PHP and it just won't stay running. I can run it, and keep it running in Terminal, but it just won't work in PHP. I can run things like apache(2), and other things that auto-fork into the background, just nothing that simply runs right where it's created. I hope I've included everything. This problem has been racking my brain for days now and it's just got me frustrated.. Anywho, thanks for taking your time to help out a frustrated 'ol php coder
  4. Hmm. WOuld it be faster then the one I posted?
  5. What does AS derived do? Will that query do the same as the one I fixed up?
  6. Ok, I'll explain what it was doing and what I did to fix it. SELECT * , max( id2 ) FROM `hi` GROUP BY `id` ORDER BY max( lastpost ) DESC LIMIT 0 , 30 works. You suggested SELECT * , max( id2 ) FROM `hi` GROUP BY `id` ORDER BY lastpost DESC LIMIT 0 , 30 Which for some reason sorted the results by the order of the id2=0 lastpost row. Well, I needed the results to be ordered by the newest posted in order, not the order the main threads were posted in. If that makes any sense. I can't put in words what I have in my head very well... :S
  7. Aww, I tested it out again, and it is doing everything right, but it seems to order the id2=0's by their lastdate instead of the id2=?'s last date. How would I fix that? Edit: I got it!! Finally. Thank you a whole bunch for your help. This is my final usage: SELECT * , max( id2 ) , max( lastpost ) FROM `hi` GROUP BY `id` ORDER BY max( lastpost ) DESC
  8. But that will search only the rows with id2 of 0 for the last posted date. I want it to search every row, but only spit out rows with id2=0. Unless that is what it does, which I'm sure it doesn't. I'm sure its something simple. At least I hope it is.
  9. It looks like those should work, but to no avail. Really, I want to order all of the posts by the posted date, but only get info from the post of id2 = 0. I've tried one way, but I'd have to check to to see if I already did that number. Ok what I'm really doing is making a forum. So I'm trying to order them by the last date posted in each "thread". so the id is the thread number and id2 is they post number. So to get the newest post, I figured I'd just order the posts by the last date, if taht post in thread 203, then it will pull info for 203,0. If I then post a new thread making it 204, then I want that post to be displayed. This code works: SELECT * FROM `hi` ORDER BY `hi`.`lastpost` DESC LIMIT 0 , 30 But I don't want to check a list of values to see if I already printed out thread 1 already. So I was hoping that MYSQL had an efficient way of doing this.
  10. Ok, I'm using a distinct to pull records off my db. Well, I have id | id2 | comment | lastdate ------------------------------------------| 1 | 0 | Hello | 2007-04-12 23:26:39 | 2 | 0 | Sup? | 2007-04-12 23:27:50 | 1 | 1 | Hi there | 2007-04-12 23:46:33 | 3 | 0 | Hello | 2007-04-12 23:47:26 | 2 | 1 | Nutton | 2007-04-12 23:50:29 | Well, I want to display the newest comment for each id. But I'm not sure how to call / work with my code to get the latest comment, but post infor for the first one. So if comment 2,1 had the latest comment, my db would print out comment 2,0 info. If the next newest comment was 1,1 then it would then print out the 1,0 info after the 2,0 info. I've tried doing this: SELECT DISTINCT `id` FROM `".$fname."` ORDER BY `lastdate` DESC But it seems to order it wrong. Any help is appreciated and I'll be glad to explain more if needed.
  11. Well, some how I got it. I (searched for the error and found/)read: [a href=\"http://www.webmasterworld.com/forum88/1100.htm\" target=\"_blank\"]http://www.webmasterworld.com/forum88/1100.htm[/a] And tried what the guy on the last post did. And it worked for me too. I think that mabye my cache or something had a bit of the old code too. So, deleting the old one, creating a new text file, might of triggered a complete file refresh or something. I'm not sure. But it works perfect now. Thanks everyone for the help! :)
  12. No. I'm going to it from a form. So, on index, I have a form that asks for the username and password, and when you hit login, I get the data through the $_POST command. It seems the problems are only the cookie and the head( commands. So, setcookie("in", "", time()-36000); setcookie("upass", "", time()-36000); setcookie("id", "", time()-36000); and setcookie("in", $user, time()+36000); setcookie("upass", $pass, time()+36000); header('HTTP/1.1 301 Moved Permanently'); // Clean 301 header header("Location: index.php"); // Jump to the link are the problemed code. Here is the Index login code: [code] echo "You are not logged in!<br /><form method='POST' action='in.php'>     <p>Name&nbsp; :&nbsp; <input type='text' rows='1' name='name' cols='20' size='52'><br>     Passqord&nbsp;&nbsp; :&nbsp; <input type='password' name='pass' size='52'><br>     <p><input type='submit' value='Log In' name='B1'></p></form>";          } [/code]
  13. So would anyone happen to know what my problem could be?
  14. That space was from the forum. It's not really there on the code. And there isn't any spaces on the top <?php either. Code of the top: [code]<?php $username = "user10342"; $password = " Secret "; $hostname = "localhost";     $dbh = mysql_connect($hostname, $username, $password)     or die("Unable to connect to MySQL"); $selected = mysql_select_db("12141",$dbh)     or die("Could not select dab");     $once = 0; if (isset($_COOKIE['in'])){ [/code] That is only the top of the code.
  15. No, I don't have any includes. Here is the resulting HTML code from the page that has errors. [code]<br /> <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/vhosts/dabgames.3000mb.com/forum/in.php:1) in <b>/home/vhosts/dabgames.3000mb.com/forum/in.php</b> on line <b>38</b><br /> <br /> <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/vhosts/dabgames.3000mb.com/forum/in.php:1) in <b>/home/vhosts/dabgames.3000mb.com/forum/in.php</b> on line <b>39</b><br /> <br /> <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/vhosts/dabgames.3000mb.com/forum/in.php:1) in <b>/home/vhosts/dabgames.3000mb.com/forum/in.php</b> on line <b>40</b><br /> <br /> <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/vhosts/dabgames.3000mb.com/forum/in.php:1) in <b>/home/vhosts/dabgames.3000mb.com/forum/in.php</b> on line <b>41</b><br /> You've been logged in! <a href=index.php> Click Here to go Back</a><br /> <b>Warning</b>:  session_start(): Cannot send session cookie - headers already sent by (output started at /home/vhosts/dabgames.3000mb.com/forum/in.php:1) in <b>/home/vhosts/dabgames.3000mb.com/forum/in.php</b> on line <b>58</b><br /> <br /> <b>Warning</b>:  session_start(): Cannot send session cache limiter - headers already sent (output started at /home/vhosts/dabgames.3000mb.com/forum/in.php:1) in <b>/home/vhosts/dabgames.3000mb.com/forum/in.php</b> on line <b>58</b><br /> <br /> <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/vhosts/dabgames.3000mb.com/forum/in.php:1) in <b>/home/vhosts/dabgames.3000mb.com/forum/in.php</b> on line <b>59</b><br /> [/code] Here is the URL to the file-ish. Just type in admin for the username then guest for the password (all lowercase). Then you will get the error page right when you hit login. [a href=\"http://dabgames.3000mb.com/forum/\" target=\"_blank\"]http://dabgames.3000mb.com/forum/[/a]
×
×
  • 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.