Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. It's still hard to know what you're wanting to achieve without an example of what you're trying to do with the shell open, but I'm sure you can find your answers. Here's an example use of the SSH2 PHP lib: http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/
  2. Why do you not post a var_dump on the variables being inputted into your database? It's of obvious help to debug sources, as it could be a clue to your blank insertion problem.
  3. What do you mean? You cannot use PHP to maintain an active server session with a terminal, all you can do is feed commands to it. There is a thing called SSH that can do this for you, provided you understand in the first place this can't be handled via PHP itself.
  4. Yes, It may be possible to run the terminal but what are you attempting to do with it? If you're wanting to run commands such as 'ls /usr/bin' then you need not a terminal, or are you trying to make a direct 'link' to feed it commands?
  5. what? We're wondering why it would display the PHP source in the first place. Are you viewing the file directly on web browser by chance? (IE: C:\files\this.php) And as well, is it .php? Web servers are not really configured to run them off default extensions like .phtml etc.
  6. The query will pull the data from the table, mysql_fetch_assoc will return the cells in the database into an array. while ($row = mysql_fetch_assoc($result)) { echo $row['foo']; } This will display the row 'foo' within 'table'. Simple example.
  7. Well, you'd normally place it into a variable so you can go over the rows: $q = mysql_query("SELECT * FROM users ORDER BY Kills DESC LIMIT 1"); while($row = mysql_fetch_array($q)){ echo '<pre>'; echo print_r($row); } That can give you a better idea of what you're doing.
  8. Misread the post so I edited wondering why he was asking that, assumed he wanted stats of his own, and not use a third party service, not sure why he asked that.
  9. I'd highly unrecommend using this code, as it is a direct entry into a mass amount of problems.
  10. It seems you forgot a concatinating operator in your string after 'date("Y-m-d",$now)"' $datestring = ""; $now = time(); $datestring .= "<p>Seconds since Jan 1, 1970: $now</p>"; $datestring .= "<p>Today's date: " . date("Y-m-d",$now) . "</p>"; echo $datestring; This will work.
  11. You greatly need to re-evaluate how a programming language functions. I'd recommend turning error reporting on, for the first place. So "CRITICAL ERROR"s mean it's correct?
  12. Hm! Try running this code echo ip2long('REMOTE_ADDR'); And it fails! If you truly expect to convert a string into an IP, you're making no sense and may as well not even attempt to. echo ip2long($_SERVER['REMOTE_ADDR']); And oh look, it works
  13. It of course has to parse the code to find the ending brace, It does not /run/ it but it does debug it. $myVar = true; if (isset($myVar)) { echo "I exist?"; } else { !@^&*What am I?^%$an error?&&&^&*^ } Why not try that code?
  14. What TheFilmGod stated is what most developers use (in case of exportation or clean coding) if they are going to separate their libraries as so. /LIB /CSS /etc.css /PHP /Functions.php /Validation.php /Database.php /JS /AJAX.js /jQuery.js etc. That structure is pretty much as good as you're going to get, if you want to re-use libraries and classes for your new work, as you can call the libraries in a fashion you intended. But again: you will be using old code.
  15. Well I can assume your FOR loop will never run as intended, as you're telling it to go until $j is less than $teachers, which is assumingly will always be.
  16. It depends purely on the data that is placed within it. Looking at your session arrays, It would be safe to say that you are not passing hundreds of thousands of array keys at a time in place of a database or whatnot. To answer your question it should not matter at all with speed how deep your array is unless it has an obtuse amount of data.
  17. It would help if we knew what kind of project you were doing, looking from the structure, I've not used something like that since I've worked with C++. It's essentially pointless to split all your 'library' classes into different files under another root. If you were to create a huge program with wrappers to the database and required more than you'd expect, then maybe you should use an infrastructure like so. What do you mean? Every single function should not have to be within a class, if the class is relevant (such as Employees extends Workers), then the returnTax() function should probably be included, but not the addTwoPlusTwo().
  18. Port 27015 from what I can see is a common gaming port, so it could be possible it was opened or not blocked in the first place. Port 1337, on the other hand is used for many back door trojans. You are aware, the slang term '1337' did originate from the COTDC releasing 'backdoor orifice' , a prolific trojan at the time utilizing that port. Bit of history for you.
  19. You'd preferrably use the isset function. Here is a (shouldbe) working example: <?php if (isset($_GET['id'])) { $id = htmlentities(strip_tags($_GET['id'])); //Should really be this.. if ($id == "test") { echo "Welcome to the test page! ID = test"; } else { echo "ID is not valid, please re-enter"; //If ID = blahwhatever } } else { echo 'ID is not defined.'; } ?>
  20. There should be rich documentation (atleast I assume for Photobucket) on how to use your API key, I assume they should included PHP and/or JS snippets to show you how to utilize your API.
  21. Why did you mention setcookie's expiration time then? Did you tl;dr PFM?
  22. Are you 100% sure they fit together? Try checking the result of: echo= '/home/thebasem/public_html' . $row['PosterURL']; It may be possible the path is not completely correct, such as a missing forward slash. This would cause file_exist to return a false, as you could imagine. Only thing I can think of right now.
  23. Then use date('d/m/Y') in place, in that code. $issdate="10/12/2009"; $newiss=date('d/m/Y', strtotime($issdate) + 60 * 60 * 24 * 15); echo $newiss;
  24. Are you putting it within <?php tags? I run the very same code and I get this: '10/27/2009' $issdate="10/12/2009"; $newiss=date('m/d/Y', strtotime($issdate) + 60 * 60 * 24 * 15); echo $newiss;
×
×
  • 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.