Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Looks right to me, did you have the library installed, like Ben said? Here's how you can check:
  2. Can we see the relevant code?
  3. Hmm, it looks right, you sure you're passing through the right username? It works for me in my test scenario: $username = "55h+5"; if(!preg_match('/^[A-Za-z0-9\+\-\_]+$/i', $username)) { echo "bad"; } else { echo "good"; } ?>
  4. Can you just do a print_r($array) on your array and post it that way, it's much easier to read
  5. Are you using Drupal? Not sure what exactly could be the problem... Did some investigating and found the same issue but different solutions: All these solutions were taken from this thread: http://drupal.org/node/227311
  6. That's good to hear, do you mind sharing the final code?
  7. Right, my bad, need to get some sleep... So OP, if there are 1 or more even numbers then it won't work...? Like everyone else said, you may want to post some more code and elaborate on what, "it won't work" means.
  8. FYI: You can store IPs as unsigned INTs so they can be a little more dynamic (ie - search for a range). You have to use these functions though to convert them: INET_ATON and INET_NTOA. Please mark as solved if so, thanks
  9. It probably outputs 0 because $y and $f aren't ever initialized, they don't exist! $y3 = $y * $y1; $f3 = $f * $f1;
  10. What exactly doesn't work about it?
  11. You can try to select that ip and if the query returns and results (> 0) then it exists and return false, if not, proceed with the insertion: function newview($ip){ $q2 = "SELECT ip FROM iplist WHERE ip = '$ip'"; $result = mysql_query($q2); if(mysql_num_rows($result) > 0) { return false; } else { $q = "INSERT INTO iplist (ip) VALUES ('$ip')"; $result = mysql_query($q, $this->connection); return $result; } } ?> BYW, what datatype are you storing IP's in the database as?
  12. - A rate your date site with a dark gray background... need to pick another color scheme. - Graphics are a little dull. Banner and hearts in particular. - Need some more features, I know it's reading about others' dates but, there's literally nothing else to do. - IMO, the header/footer should be centered. - It's not bad, good idea, needs some tweaking. Do you have a test login?
  13. I meant, what doesn't work about it? Errors? What does it do? What doesn't it do? What is it supposed to do?
  14. Looks fine. Are you sure messages2.php is in the same dir as this script?
  15. Define: (use tags please)
  16. What do you have done so far? What kind of knowledge do you possess? Is there something specific you need help with or are you building this from scratch? Assuming you're going to be using PHP and MySQL, read this: PHP and MySQL.
  17. Looks fine to me, and works on my local machine. Although, you should put quotes around attribute values. Are you sure messages2.php is in the same directory you're calling that form from? Can we see more of the code?
  18. You could also do an .htaccess redirect, which may be the smoothest.
  19. Then why are you posting in the PHP section? What language do you want to redirect in, HTML, Javascript?
  20. What do your errors say?
  21. WTF!? ...no special at popeyes? (51 seconds, but between reading this post, waiting for the video to load, and finding another thread in violation, you should be ready for another report.)
  22. Try: if (!preg_match('/^[A-Za-z0-9\+\-\_]+$/i', $username)) You were escaping the escape for the plus sign. You also were missing case-insensitive parameter 'i' and a parenthesis. Do you want it to start or end with a specific character, cause you don't need the '^' and '$' if so.
  23. Use the aggregate function, SUM().
  24. This seems more like a MySQL issue.
×
×
  • 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.