Jump to content

Jacques1

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    209

Posts posted by Jacques1

  1. The effeminate special-little-snowflake attitude isn't going to help you in any IT community. If you want people to take you seriously, learn to shut up and listen. There's nothing worse than newbies who try to sound smart when they clearly have no idea what they're talking about.

     

    I do NOT have to change the date format

     

    I said data format, not date format. Stop babbling, then you might actually get what people are telling you.

  2. This time, I'm going to avoid cheap jokes about Wordpress users who think they're programmers. Let me put it this way: If you ever want to solve real problems and get past the copy-and-paste-from-Stackoverflow stage, there's a lot for you to learn.

     

    What you just can't seem to understand is the concept of choosing the right data structure. You've now spent at least two days working on a trivial interval search, and you still haven't managed to do anything but add another layer of duct tape to your code. Have you never wondered why you need so much time and help for simple problems? I'll give you a hint: Storing dates as strings in an unsorted array is probably the dumbest possible structure for an interval search.

  3. The problem is that you aren't looking for help. You want others to do your job, for free.

     

    While you're pretty good at begging for code and getting people to spoonfeed you, that's also the reason why you don't make any progress whatsoever. I hear you complain a lot about shitty jobs, bad code you've inherited, all kinds of limitations etc. Have you ever wondered why nobody lets you do more interesting tasks? I'll give you a hint: When somebody can't echo a variable after 7 years of programming and needs Internet forums to do that for him, then people are going to question not just his competence but also his attitude.

     

    So maybe it's time to grow up and take responsibility instead of blaming everybody else and acting like a spoiled child.

    • Like 1
  4. Anyone else able to help?

     

    You've been told exactly how to fix your code. On top of that, you've been given alternative code. If that's still not enough, I'm starting to doubt your willingness to work on the problem.

     

    This is no We-write-your-code service. After 7 years, you should know that.

  5. I haven't written any code. I've told you what's wrong with your code, but you've appearently decided to rewrite it anyway. That's fine, but then you should have a basic understanding of what that code you've copypasted does. If you don't even know what to echo, maybe you should go back to the code you do understand.

  6. No, that not an issue when you are dealing with DateTime objects.

     

    And yet you are using strings, not DateTime objects.

     

    So the real question is how to map those strings to DateTime objects, yes? Because usort() has nothing to do with your problem. As soon as the array elements can be compared with the standard operators, you just call sort().

  7. <?php echo ; ?>

    is not actually echoing anything.  What's missing here?

     

    How about: That what should be echoed (hint: there's a variable containing HTML markup).

     

     

     

    Hope that helps?

     

    We know what you want. I'm not sure if you're reading the replies, though.

  8. Look, none of us is a mind reader, and we're not sitting in front of your screen. If you want help with your code, we need to actually see that code (not just random fragments), and it's your job to do basic debugging. Like: What is the value of $page after the code above?

     

    Did you read my reply regarding the code error?

     

    And your directory check still makes no sense. Have you symlinked/copied the exact same script into multiple directories? Why would you do that?

  9. This doesn't look right:


    } else if ($dir = 'mail') {
                  ^^^^^
    

    But, yeah, a tiny bit of information might help. Besides, those directory check gymnastics look very weird and fragile. Why can't you have a proper routing mechanism like with your other pages?

  10. You have an opening brace in line 11 which is never closed. To avoid this kind of error, you should use consistent formatting.

     

    Note that a cookie-based check is entirely useless, because the user can just delete the cookie. In fact, an automated attack script won't even accept your cookies. Why should it do you that favor?

     

    The check also seems logically flawed. You first let the user log in regardless of the counter. And then you check whether the user is allowed to logged in -- but that's already too late.

  11. Yeah, well, so what is the problem? What should the data look like?

     

    You keep saying that only the first line is read, but how did you determine that? What specifically is missing? I'm not a mind reader.

     

    If you want me to take a wild guess, I'd say you're missing the “UNT”. Your function extracts everything between “UNH” and “UNT”, but your sample data has no “UNT”, so nothing gets extracted. Unless you've left out all relevant bits, which would be somewhat silly.

     

    In any case: Do some basic debugging with var_dump() so that you can provide concrete information. I'm not interested in guessing games with foreign languages and exotic data formats.

  12. The form has zero bot protection, so get ready for a lot of spam and possibly people trying to flood your inbox. If you don't want to annoy your customers with CAPTCHAs, that's fine, but you should consider to at least implement basic counter-measures:

    • an invisible trap field which must not be filled; this will stop a lot of the more primitive bots
    • an IP address check against a spam blacklist (like Project Honey Pot); if the IP is fishy, make the visitor solve a CAPTCHA

    Calling htmlspecialchars() without the ENT_QUOTES flag and an encoding is risky, purposely omitting it is even riskier. The proper approach is to escape all output data, unless you explicitly want it to contain HTML. Write yourself a wrapper function:

    function html_escape($data, $encoding)
    {
        return htmlspecialchars($data, ENT_QUOTES | ENT_SUBSTITUTE, $encoding);
    }
    
    • Like 1
  13. I have no idea what you're doing there. You're supposed to replace the entire fopen/feof/fgets stuff with a single file_get_contents() call. Like this:

    $arquivo = file_get_contents('/path/to/file');
    

    Note that accepting arbitrary files and moving them around on your server is dangerous. Anybody can upload malware this way. It's not even clear where you want to move the files, because you haven't provided a target path, just a filename. If you just want to read the content, don't move the file at all.

×
×
  • 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.