Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. The other functions will be getting called in a loop, or using a loop within them.
  2. urldecode
  3. mysqli_query() returns false (a boolean) on failure, which suggests there's a syntax error in your SQL. You should always handle the error when making query calls: $data = mysqli_query($dbc, $query) or trigger_error('SQL Error: ' . mysqli_error($dbc), E_USER_ERROR); Or to unify the handling you could define a function that does similar and call that in the 'or' clause.
  4. Remote service? AJAX isn't cross-domain.
  5. This kind of 'complex' logic should be within your application logic (PHP), or a MySQL procedure if you use them. Standard SQL isn't capable of altering the flow like that, it's purely for querying data. You'd have to MySQL's extensions (procedures, functions, triggers, etc.) to use flow-altering constructs like that.
  6. When I run that, the error console tells me:
  7. $allowedfuncs = array('xmlstring','remotefunction2'); if(in_array($_get['xmlstring'], $allowedfuncs)) { This condition makes no sense. You're defining "xmlstring" as a valid function, then checking if the xmlstring parameter's value is within the array? Going with the example URL you provided, that's equal to: if (in_array(20, array('xmlstring', 'remotefunction2')) { In which case you're always going to enter the else clause and kill execution.
  8. You mean the channel/image? Items within a feed can't have an image. Is this an RSS to HTML processor of some kind?
  9. Nope, he's just the fixed the issues.
  10. Adam

    Help please

    I'm not sure exactly how you want that fitting into your code, but to remove 1 from a variable if it's more than 1 is simple: if ($invent1['amount'] > 1) $invent1['amount']--;
  11. The problem is likely down to you trying to access xmlhttp.responseText before it's available. You need to bind the handling code to the 'onreadystatechange' event, and only attempt to use the response text once it's ready: xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var returnValue = xmlhttp.responseText; document.write(returnValue); } } That bound function will be called several times and only when the ready state is 4 (ready) will the response be handled. There's also a check to make sure the HTTP status returned was 200 (OK).
  12. Do you get an error in the error console?
  13. Yeah, but I wouldn't go with XAMPP to be honest. What OS does the server run? Is there a web server installed already?
  14. Yep. You'll end up with identical values, except the associative keys will be numeric. Just remember you do loose the name, so you'll have no idea what each value is.
  15. You're trying to insert a null value into a column that doesn't accept null values.
  16. Not if it's an associative array. You can loop through the post array and store them in a numerically indexed array though: $array = array(); foreach ($_POST as $param) { $array[] = $param; }
  17. It's quite likely they're just blocking >25 connections from a single user.
  18. You can check what's in the $_POST array with var_dump or print_r. Then you just need to reference the key: echo $_POST['key']);
  19. Is this a local or remote server? There may be a connection limit imposed. If you close the connection within the loop do you still get the same error, or are you already?
  20. Most likely you have a CSS declaration somewhere else in the code that's increasing the size. Look for in-line <style> tags or external CSS <link> tags.. Then post the content of those.
  21. What do you mean by 'merge' exactly?
  22. How do you 'loop the JavaScript' then?
  23. Hell yes! 3600 would be a ridiculous length for an array. Using a relational database this would be easy. Just create your initial table containing the "nid" and phone number (and what every else is needed), then create a second table for the keywords - use the "nid" as the foreign key to link the keywords to the other table. That's a very brief over view, but should give some food for thought.
  24. You say "only running window(...)" - did you bind it to the window.onload event? Could you show the code you were testing here?
  25. Correction to last code: if (array_key_exists($_SESSION['ct_source'], $numbers)) { if (!empty($_REQUEST['kw']) && array_key_exists($_REQUEST['kw'], $numbers[$_SESSION['ct_source']]['keywords'])) { return $numbers[$_SESSION['ct_source']]['keywords'][$_REQUEST['kw']]; } return $numbers[$_SESSION['ct_source']][0]; // <-- here }
×
×
  • 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.