Jump to content

Barand

Moderators
  • Posts

    24,605
  • Joined

  • Last visited

  • Days Won

    831

Everything posted by Barand

  1. $results = new SimpleXMLElement($responseXml); There's a good chance that it is in $responseXml echo "<pre>$responseXml</pre>";
  2. Can you post the original XML data
  3. If you add 100 new ones every second you are in danger of running out of numbers in only 2,924,712,086 years
  4. $mysqli->query("SET ...") where $mysqli is the mysqli connection object.
  5. In the PHP, create an array to store the content destined for each div. Return the json-encoded array <?php // set up an array to hold the // contents of the divs $results = []; // get contents for div A and store in the array $results['A'] = "Contents of div A"; // get contents for div B and store in the array $results['B'] = "Contents of div B"; // JSON encode the array and send echo json_encode($results); ?> In the AJAX call, populate the divs from the returned response // ajax call $.get ( "my_ajax.php", function(data) { $("#divA").html(data.A); // put results into their $("#divB").html(data.B); // respective divs }, "json" )
  6. When you first load the page, no data has been posted. You need to check if the data has been sent and process the data only if it has if ($_SERVER['REQUEST_METHOD']=='POST') { // form processing code goes here }
  7. Have you tried using simpleXML? http://uk1.php.net/manual/en/simplexml.examples-basic.php
  8. Use a recursive function EG $dir='path/to/folder'; $results = []; getFiles($dir, $results); // show results echo '<pre>', print_r($results, 1), '</pre>'; function getFiles($dir, &$results) { $d = dir($dir); while (false !== ($entry = $d->read())) { if ($entry=='.' || $entry=='..') continue; if (is_dir($dir.'/'.$entry)) { getFiles($dir."/$entry", $results['folders'][$entry]); } else $results['files'][] = $entry; } $d->close(); }
  9. You can't. You would have to use clientside processing, such as javascript.
  10. I suspect it's because it uses "complex string syntax", just as $str = "ABC{$array[1][2]}"; requires the {..} whereas $str = "ABC$array[3]"; does not. http://uk1.php.net/manual/en/language.types.string.php#language.types.string.parsing
  11. Use braces $string2="foo: {$obj->p2->p21}";
  12. If it were your own code you'd know exactly why it was there. It seems your idea of "programming" is to copy bad code from from the internet and, when it doesn't do what you want, post it here for us to get it working for you. That being the case, thank you for moving on elsewhere. On the other hand, if and when you get serious about learning, we'll be happy to help.
  13. Sorry for pointing out those unnecessary aspects of your code. I was merely asking why you thought the concatenation of the empty strings was required. No rudeness was intended, unlike your response. I appreciate you must feel an absolute idiot right now, and I am sure no one will deny that you have every right to do so. After all, it was your code so no one else is to blame. Your subsequent petulant behaviour and hurling of profanities at other members (against forum rules by the way) merely reinforces that opinion.
  14. The question is if (!isset($_GET[''.$LINK_NAME.''] ^ ^ | | +------------+-- WTF are these for?
  15. The attached php files in reply #5 do exactly what you said you want to do - retrieve from db and add map markers via json data.
  16. In your original code you had How did you know what the variables were?
  17. At what point is $obj->isConnected converted to a string?
  18. I guess you need to give it over 2 seconds of actual work to do
  19. json_decode
  20. You didn't look at the code samples in that thread then?
  21. ->setCellValue('F'.$i,$row['prod_sell_override']>0 ? $row['prod_sell_override'] : number_format($row['prod_trade']*100/70), 2) ?
  22. You would lessen the load by putting an index on the user_id column.
  23. Have you tried number_format()?
  24. or $data = file('hansford.txt',FILE_IGNORE_NEW_LINES); natsort($data); foreach ($data as $line) { echo "$line<br>"; } gives #1A - Kessenich #1B - Adams #8 - Johnson #50 - Smith #100 - Sanders
  25. see https://developers.google.com/maps/documentation/javascript/markers and also this topic https://forums.phpfreaks.com/topic/302364-need-help-to-clear-concept-of-google-maps-integration-in-php/?do=findComment&comment=1538471
×
×
  • 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.