Jump to content

DarkWater

Members
  • Posts

    6,173
  • Joined

  • Last visited

    Never

Everything posted by DarkWater

  1. What OS are you running? It's very strange that this isn't working for you, because I just tried pgrep from PHP and it worked just fine. Maybe it's some php.ini setting that I don't know about, but idk. Do you have access to your php.ini?
  2. @CV: That's why he included the document path... I'd suggest checking out realpath() to fix up those ../'s and stuff.
  3. Wow, that was very...brusque. =P Nice way to put it though.
  4. { } are curly braces. ( ) are parentheses. [ ] are brackets. Just letting you know.
  5. Absolutely. My suggestion for dates, though, would be to have it set as a DATETIME column and use the MySQL NOW() function.
  6. Lol. Btw, I saw your long post...I was going to pull a nice tl;dr, but I actually decided to read it. xD
  7. Are the shell scripts really in the same folder as your PHP script? You have ./ in front of the path, which would mean that it HAS to be in the same folder or deeper. If it's in like, ~/bin, then use a full path or hope that you have nothing else with the same name in your PATH.
  8. Don't capitalize your HTML tags! XHTML Strict would spit out an error for every single HTML tag on that page. Make them lowercase. Also, I'm not too sure I like the text on the right in the banner. If you insist on keeping it, however, it should be ειρηνική (note the accent). =P I speak Greek, obviously. Btw, it looks like a nice piece of land. How far away from Athens is Lesvos?
  9. Check out MySQL's COUNT() function and GROUP BY clause. You should be able to piece it together.
  10. 1) The design is really, really...abysmal. I thought it was a joke at first. 2) I could not decipher the point of the website at all. It was too cluttered and just unappealing. 3) Good luck making money. You might need it.
  11. Authors don't get a sexy badge. =( And we can't set our main group to Authors either. The radio button is disabled. Was that intentional?
  12. Moral of the story: You CANNOT send true GET variables to a locally included file because you aren't actually using an HTTP GET request for it, therefore Apache won't parse a request and send any variables to PHP. Just set the variables before you include the file.
  13. I hope you realize that view-source: is just a browser thing to make lives easier, correct?
  14. <?php $string = "Xbox Games"; $string = strtolower($string); $string = preg_replace("/\s+/", "_", $string); $string = str_replace(array('\\', '/'), '', $string); $string = preg_replace("/_+/", "_", $string); echo $string; ?> Might want to put that into a function.
  15. Whenever I log into the main site, it just gives me a white screen on any page I visit. Once I remove the cookie/restart my browser, the site works.
  16. That point made no sense. You just called the function multiple times with different values; you didn't pass it all in at once. Let's say you were writing for an MVC router and you needed to send extra parameters off to the proper method. You'd need call_user_func_array().
  17. Web pages don't magically have viruses...you actually have to download something. That something could be an ActiveX control (looking at you, IE), so it SEEMS like you're not DLing anything, but you are.
  18. Then don't use OOP? I honestly don't think that there's a real memory hit in storing an int referenced by a class or just a random int in the main scope of the script...
  19. Now, how do you plan on calling that function with multiple parameters that you might not know ahead of time? I guess you could compile a string together and eval() it, but it's slow. Very slow. And error-prone. call_user_func_array() does the job just fine though. Also, some functions like sort() and it's relatives and even preg_replace_callback() need callbacks for good reasons.
  20. 1) Don't ever store a list of values separated with a delimiter in a single column, or I'll go to your house and create a hostage situation. (Being creative today. ) 2) I had something like this set up on a little user system I made one day out of boredom. You have to do a join with the users table: SELECT u.* FROM friends AS f INNER JOIN users AS u ON f.friend_id = u.user_id WHERE f.user_id = '{$_SESSION['user_id']}' AND f.accepted = 1 That query fetches any given user's friends. It was copied and pasted from my PHP file, so I know it works.
  21. I guess a spot of tea-bagging is out of the question then... Lmfao.
  22. That was written 7 years ago; the code looks pretty deprecated. Anyway, what kind of validation do you mean? Actually checking if it's online, or making sure it's just a valid URL.
  23. You should just do this in Javascript. <form name="redirect" onsubmit="window.location = document.getElementById('redirect_link').value; return false;" action="" method=""> <input id="redirect_link" type="text" /> <input type="submit" value="Go!" /> </form>
  24. A User object has nothing to do with a database; queries should not be delegated to the User object. You'd probably want a data mapper that creates new User objects. Anyway, I'd suggest reading up on design patterns.
×
×
  • 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.