Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. https://wiki.php.net/rfc/finally Neat. Some examples: <?php try { return 2; } finally { echo "this will be called\n"; } //this will never be called echo "you can not see me"; // output - this will be called // return int(2) <?php function foo ($a) { try { echo "1"; try { echo "2"; throw new Exception("ex"); } catch (Exception $e) { echo "3"; } finally { echo "4"; throw new Exception("ex"); } } catch (Exception $e) { echo "3"; } finally { echo "2"; } return 1; } var_dump(foo("para")); // output - 123432int(1)
  2. In the future, please put your code in tags The problem is that you didn't use a $ on your variable names, on this line: if (empty(register_email) || empty(register_name) || empty(register_password) { EDIT: You should snip them from his post, before the wrong eyes sees them.
  3. For clarity, on this line: if (($ext == "exe") && ($fileSize <= 25000000)){ EDIT: By the way, that is a terrible way for a file type check. Use the mime type, not the file name. Check out fileinfo.
  4. I use Eclipse PDT as well, but I figured Notepad++ or Sublime Text are the closest (decent) thing to Notepad (a quick, no-frills editor).
  5. I think you meant true. Also, note that all of those "Unset" conditions will give a Notice: Undefined variable error. I know that that isn't the point, but it is good to know anyway.
  6. Yeah, I'm really taken aback when people don't understand what timezones are. Didn't elementary school teach that stuff? There's been several times when I have been playing games online and trying to coordinate an event, asking people for their timezone and they go "huh?". I have to ask where they are from, to tell them their timezone.
  7. null is unknown. an empty, oops, placeholder. ok, I'll know it when I see it! using null as a comparison, is pretty stoopid. 1 null has no relation to any other null. null was created from relational dbs, to cover when no data exists, outside join like. SELECT * FROM user, type, WHERE user.id=type.id. What if you want all users, regardless of type? Null means that there is no value, and it is not stored in memory. Empty means that it has no value, but is stored in memory (as a 0 length string). Null is sometimes used to initialize or clear a variable.
  8. Notepad? Like, the one that comes with Windows? Geez man, use a better tool. Try Notepad++ or Sublime Text 2.
  9. scootstah

    HELPPP

    You can try an .htaccess file with php_value post_max_size 10M
  10. Sure, but shaving 250 nanoseconds off script execution isn't going to account for 5 million hours, that's just ridiculous. If you're worried about the performance of your application, profile it and fix the actual problem areas - don't waste time on something that makes no real-world difference.
  11. You missed this part:
  12. Close. match_date = '" . $date . "'
  13. I may be wrong, but I believe this code will rely on the fact that thumb_id and image_id remain the same. If you are AUTO_INCREMENT'ing both fields, that may quickly become troublesome.
  14. That will result in malformed SQL; WHERE tbl_components.ID = '1' WHERE tbl_components.ID = '2' WHERE tbl_components.ID = '3' Well, that's your problem. $val is going to be an Array. I can't really help because I still don't have any idea what you're trying to do. I don't know where $results_done is coming from, and I don't know what method you are using to get data to your script.
  15. This doesn't solve anything. You still need to determine which large image is associated with which small image. Negative. It automatically makes a thumbnail using javascript. Then it's not a thumbnail, it's just a scaled image.
  16. Chrome automatically removes the "/" for me, even if I explicitly include it. So, it's just your browser.
  17. What are you doing/using to view the tag?
  18. This doesn't solve anything. You still need to determine which large image is associated with which small image.
  19. A lot of websites (especially forums) use the publicly-available usernames to login with, so this really shouldn't be a big deal.
  20. Well, you're going to have to link them in the database. Here's an example database structure: images id | title | description | name | path 0 | some image | some desc | image1.jpg | images/ images_thumbnails id | image_id | name | path 0 | 0 | image1_thumb.jpg | images/thumbs/ You can optionally use a foreign key on images_thumbnails.image_id to point to images.id. Now you have the data available to make a link. Just use a JOIN to get both rows, so that you have the thumbnail ID. Something like: SELECT i.id, i.title, i.description, i.name, i.path, t.id AS thumb_id, t.name AS thumb_name, t.path AS thumb_path LEFT JOIN images_thumbnails AS t ON t.image_id = i.id FROM images AS i;
  21. You are probably exceeding the post_max_size setting in the php.ini, which would cause $_POST and $_FILES to be empty.
  22. Where does $results_done come from? What is its value? I think it would be a lot better to construct the query, and then execute it once - rather than executing many queries. I am sure that whatever it is you are trying to do is possible with a single query.
  23. Sure, you could. But, I think you should take a look at caching, then you can have the best of both worlds. However, static or dynamic has no effect on SEO.
  24. What are you trying to do? Because there is certainly a better way.
  25. What are you using for an HTTP server? Try checking those error logs and see if anything comes up.
×
×
  • 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.