Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. This topic has been moved to PHP Coding Help because it has nothing to do with regular expressions. http://forums.phpfreaks.com/index.php?topic=362582.0
  2. This topic has been moved to JavaScript Help. In other news, this poster has been moved to Bed. http://forums.phpfreaks.com/index.php?topic=362534.0
  3. At a glance I don't see any syntax errors so I'll point out how that is wrong. Do a quick search to find out what the type= should be. Also, this is [b]obviously[/b] not an HTML question which is why I'm having a hard time imagining why you put this thread in the HTML Help forum.
  4. $result is not an array. What is the code that generates it?
  5. Depending how the likes are stored you could grab them with the first query (the one you aren't showing). Otherwise not really: you'll need three queries somewhere, be they subqueries or not.
  6. Alright, need more specific information. 1. What are the actual values of those variables? Only redact the bare minimum, and do that by replacing letters with 'X' and numbers with '0'. 2. Given those redacted values, what is the exact command you need to run? 3. How are you building these values?
  7. start hour = 14, end hour = 24, interval hours = 2 interval start hour = start hour while start hour interval end hour = min(interval start hour + interval hours, end hour) // assuming the same day interval = [interval start hour : minute, interval end hour : minute] save interval interval start hour = interval end hour loop Or a for loop.
  8. Are you escapeshellarg()ing those three variables before you put them into the command? You need to, otherwise there's a risk that there will be something in them that the shell will try to interpret. Which is the problem you're having.
  9. Assign the command to a variable, print out the variable, and see what it looks like. Also redirect stderr so you can catch any error messages. Also, 1. The /./ is unnecessary. 2. passthru() prints the output for you. 3. passthru() does not return anything. $command = '/host/Crypto/newlm/LMSignature -verify 224 -message= text -signature= ' . $signature . ' -verifkey= ' . $verifkeys . ' -hashfunc= ' . $hashfunc . ' 2>&1'; echo $command; //passthru($command);
  10. For each productNN and quantity you have, 0. If the quantity 1. Get just the NN part. 2. Subtract 1. 3. Look for the value in the array of prices under that (NN-1) key. 4. If and only if you find it then do whatever. Even easier would be if you modified the form field name to be name="product[$n]" Then you can grab the number very easily with a foreach over $_POST["product"].
  11. Use URL rewriting with a "the request doesn't exist" condition. That means virtual folders like "images" or "style" wouldn't work if they were actual directories on your site. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ...
  12. Do you want a subfolder or a subdomain?
  13. I don't remember enough of SMTP but it would be somewhat easy. You can check the response from the server for each of the commands and look for specific good and specific bad messages.
  14. The only mechanism available to you is whether $SMTPChat is an array (success) or null (failure), and all that indicates is whether the code could connect to the SMTP server. It has nothing which can tell you whether it actually sent the mail (mostly because the code doesn't even check that).
  15. $SMTPChat = $SMTPMail->SendMail(); Do whatever based on the value of $SMTPChat.
  16. So what does it output?
  17. requinix

    mysql help

    Sounds like the table isn't empty. Because the table definition clearly states that the id must be unique.
  18. What data type do you use for the documentfile column? It needs to be a binary type, not a text type.
  19. $lastimage is the path to the file. header("Content-Type: image/jpeg"); // tell the browser this is a JPEG image header("Content-Length: " . filesize($lastimage)); // be nice and say how large the image is readfile($lastimage); // output the file exit; // stop the script so it doesn't accidentally do anything else
  20. Looks like the image data was UTF-8 encoded. Do you do anything about that when uploading images or inserting to the database?
  21. $post = $post->{'regular-body'}; You overwrote $post with something else.
  22. I don't get 6026 either. I didn't know what out was supposed to be so I just guessed at a boolean. Try if (out != 0) { Also I didn't put in the timezone stuff because I wasn't even sure you needed/should have it. Feel free to put it back. And for the record, as an example nicetime(new Date(2012, 0, 1, 0, 0, 0, 0), true)
  23. I kiiinda rewrote it. Felt like it. function nicetime(a, out) { a = parseInt(a instanceof Date ? a.getTime() : a); var now = new Date(); var d = Math.floor((now.getTime() - a) / 1000); if (!out) { return d; } if (d return "Now"; } var chunks = [ [60*60*24*365, 'year', 'years'], [60*60*24*30, 'month', 'months'], [60*60*24*7, 'week', 'weeks'], [60*60*24, 'day', 'days'], [60*60, 'hr', 'hrs'], [60, 'min', 'mins'], [1, 'sec', 'secs'] ]; var nice = []; for (var i = 0; i if (d >= chunks[i][0]) { var count = Math.floor(d / chunks[i][0]); nice.push("" + count + " " + chunks[i][count == 1 ? 1 : 2]); d -= count * chunks[i][0]; } } return nice.join(" ") + " ago"; } I doubt that's exactly what you want but it should be close.
  24. It's possible, fairly straightforward, and cool, but it's generally not a good idea. You lose out on some features by doing it that way and you'd probably end up writing weird-looking code in order to use it. As for extensions, wouldn't you just end up writing one to be used on just one of the sites? A framework is your best bet: you can push out a lot of the menial work to it and extend the functionality with common code that all your sites are going to use (such as the login/registration mechanism), and it leaves you in just the right place where you can write good, solid code for the unique functionality.
  25. You have to go through the children and attributes methods before you can access them. How those work is by returning to you a list of elements/attributes located in the new namespace. Or returning a copy of the original object with its "current namespace" changed. Whatever the mechanism the end result is basically the same. Anyways, code. echo $xml /* default namespace */ ->children("f", true) /* "hppt://www.test.org" namespace */ ->name;
×
×
  • 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.