Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. Because you foreach as $post in all of them. $post gets overwritten in the inner-loops. Name them different in each loop.
  2. css/javascript in the HEAD. PHP anywhere (it gets processed before output to browser). noscript where ever you need it (head/body)
  3. You probably also want to use an OR instead of an AND, otherwise the error will only trigger if both are empty. You'd also want to do that check before you try to add the 2 numbers together.
  4. Around line 5: if (empty($num1 and $num2)) { Error: unexpected T_LOGICAL_AND, expecting ')' The error is saying that it doesn't expect the AND there, and it's expecting a ) instead. This is because empty() only accepts one argument, so you need to split that into two empty() statements. if (empty($num1) AND empty($num2))
  5. I don't know what you mean.
  6. foreach($space as $s) { foreach($location as $l) { foreach($ageGroup as $a) { foreach($duration as $d) { foreach($footfall as $f) { echo "$s, $l, $a, $d, $f = SOMETHING HERE<br>"; } } } } }
  7. You should convert your tables to utf8 as well.
  8. In addition to the above, make sure your db is properly indexed. Old, but good read: http://www.databasejournal.com/features/mysql/article.php/1382791/Optimizing-MySQL-Queries-and-Indexes.htm
  9. That's not true. You can tell apache to parse any file extension as php, but Apache has to be set up that way using the AddType directive.
  10. did you try to echo pathinfo("uploads/$fuser/$file", PATHINFO_FILENAME) to see what the value is? I bet its a full filename and not just the extension. Probably want to be using PATHINFO_EXTENSION there
  11. Not sure why that worked and what I had in my last post didn't. They look the same to me Oh, maybe you tried it before my edit.
  12. try: json_decode($response->GetProspectAsJSONResult, true)
  13. http://php.net/manual/en/function.json-decode.php
  14. We use a last_activity field that gets autoupdated whenever the user does something. Then we just look for users active in the last x minutes to determine who is online. Obviously not 100% accurate, but avoids some of the problems that ginerjm refers to. last_activity timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  15. You don't need a loop at all. Just grab all results. http://php.net/manual/en/mysqli-result.fetch-all.php
  16. Create a form for them to input the data?
  17. Instead of: $sqlError = "Error writing to database\n"; Which tells you nothing useful, grab the actual error from mysqli $sqlError = mysqli->error;
  18. It's not really any use trying to update this as it's already deprecated code! mysql extension will not be available in a future version of php, so even if you get this code working it won't work for very long into the future unless you never plan on upgrading PHP. Use mysqli or PDO db driver.
  19. Probably because the php versions are different and have different extensions enabled
  20. You don't need to replace the question mark
  21. It means you don't have the mysqli extension enabled in your php.ini.
  22. Another thing, why are there php tags wrapping your jquery $.post()?
  23. Where are these values coming from? $.post( "send.php", { zProduct: zProduct, zBay: zBay, zMeasures: zMeasures, zDoor: zDoor, zPlinth: zPlinth, zMount: zMount, zBattery: zBattery} ); Also, if you are using jQuery, why are you doing this stuff? document.getElementById('abc').style.display = "block"; document.getElementById('formtable').hidden=true; document.getElementById('DivDesc').hidden=true; document.getElementById('DivSend').hidden=true; document.getElementById('DivSum').hidden=true; When you could just $('#abc').css('display', 'block'); $('#formtable, #DivDesc, #DivSend, #DivSend').hide();
  24. post your current code
×
×
  • 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.