Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Pass just the key and look up the value while you're in the database anyways.
  2. Very few people around here are willing to look at code like that when you don't put it in tags. You're probably missing a } somewhere.
  3. It's very likely that file does exist, even if only on the server and not in the files you were trying to upload. Does it look malicious?
  4. The "something obvious" would be the mysql_query() to actually execute $result. And try to use the newer and better mysqli or PDO extensions instead of older and deprecated mysql extension and its mysql_*() functions.
  5. I believe that special formatting happens through the xdebug extension, but you can get links in the regular error messages with the docref_root setting.
  6. You see the bolding in the messages? That's not plain text. What are you trying to get out of them?
  7. Are you absolutely sure you're looking at the right line in the right file? Because it looks fine to me too. It may sound silly but try deleting the line and carefully typing it again.
  8. PHP will not output it for you - there is code somewhere that is doing this. It's specifically using print_r(), if you want something to search for. So... make it not do that.
  9. And the problem is...? strtotime() doesn't accept m-d-Y format. If you know that's the format of the input then you need to get the pieces yourself. if (preg_match('/^(\d\d?)-(\d\d?)-(\d\d\d?\d?)$/', $_POST["date_added"], $matches) && checkdate((int)$matches[1], (int)$matches[2], (int)$matches[3]) { // assume it's m-d-Y format $date = mktime(0, 0, 0, (int)$matches[1], (int)$matches[2], (int)$matches[3]); } else { $date = strtotime($_POST["date_added"]); } Or if you don't mind using m/d/Y format (ie, with slashes instead of hyphens) that will work. Even better: unless you need lots of flexibility with dates, give the user a datepicker-type widget and you can always get a standard format (like Y-m-d) back from your form.
  10. Hadn't considered the purpose. Yeah, an associative array like that would be much better than trying to stay with just the $r variable >_>
  11. Well... alright. Assuming all the directories to choose from are at the same level (same parent directory) then glob + GLOB_ONLYDIR will get you an array of names you can stick into a . If you get a full path and just want the directory name, basename.
  12. Who invited Moon Moon!? Don't give users the ability to upload to any directory they wish. If you have real, actual directories then make a list of ones you do want users to be able to upload into and provide that in a dropdown or something. (Then make sure to validate that what they choose really is in that list.) If you do want any arbitrary directory then you need something smarter...
  13. Don't. Stick with the array you have. Making variables like that is bad practice and doesn't really afford you anything you can't get done through better means.
  14. You have to start from the beginning, so count and skip over s until you reach the right number.
  15. Assuming datestart and dateended are integers (not date/time strings) then you're close, you just have to fix the $sdate=mktime(0,0,0,date("m"),(date("d")+1),date("Y"));so that it doesn't go according to today's date but instead adds one day to $sdate. Like $sdate = strtotime("+1 day", $sdate);But there might be another problem. datestart and dateended: they really are integers, right? They have precision to the second so how are you dealing with the fact that you only care about the date portion? Do they correspond to midnight on their respective days?
  16. Those don't matter. The first arrow on kicken's image points to the important part: the status code. What does GMail have to do with any of this? Sitelinks where? Regardless of that, keep in mind that Google doesn't remove pages from their index immediately.
  17. Going wrong? A soft 404 is exactly what you want. It's right. Unless I'm missing something?
  18. Right. It does drop down. So what's the question?
  19. The header() has to happen before you've outputted anything. I'm guessing header2.php has some HTML? That's the problem. And please use the long open tags <?php. Not everybody supports the short tags. <?php header("HTTP/1.1 404 Not Found"); include 'log.php'; include 'info/404.info.php'; include 'header2.php'; ?>
  20. Kinda vague. Is the first insert working properly while the second is not? What's this "one line" being inserted, and as opposed to what? Put another way, if you hardcode some example values into the queries, what do the queries look like? And what's the value of $arr?
  21. The side bar. Click the "see more"? Drops down what?
  22. (cough)
  23. What site is this?
  24. From his point of you, you told him to do some amount of work, agreed to a price, and then tried to get him to do more work than was agreed upon as if you were trying to con him. He's right for increasing the price. Insert what code where to do what and why?
  25. Compare them fairly: $query = $mysqli->prepare('SELECT * FROM users WHERE username = ?'); $query->bind_param('s', $_GET['username']); $query->execute(); $query = $mysqli->prepare("SELECT * FROM users WHERE username = '" . $_GET['username'] . "' "); $query->execute();See the problem with #2? The username isn't escaped. Without prepared statements you'd have to escape it yourself, which requires knowing how to do that properly (which isn't complicated or anything). With prepared statements you don't have to, and in fact should not, escape anything. No hidden gotchas.
×
×
  • 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.