-
Posts
24,605 -
Joined
-
Last visited
-
Days Won
831
Everything posted by Barand
-
$results = new SimpleXMLElement($responseXml); There's a good chance that it is in $responseXml echo "<pre>$responseXml</pre>";
-
Can you post the original XML data
-
If you add 100 new ones every second you are in danger of running out of numbers in only 2,924,712,086 years
-
Output Local Timezone - Convert Query To MySQLi
Barand replied to energylevel's topic in PHP Coding Help
$mysqli->query("SET ...") where $mysqli is the mysqli connection object. -
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" )
-
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 }
-
Have you tried using simpleXML? http://uk1.php.net/manual/en/simplexml.examples-basic.php
-
Converting arrays into a multi-dimensional array
Barand replied to LTMH38's topic in PHP Coding Help
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(); } -
You can't. You would have to use clientside processing, such as javascript.
-
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
-
Use braces $string2="foo: {$obj->p2->p21}";
-
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.
-
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.
-
Plotting dynamic markers from MySQL DB in Google Maps
Barand replied to Texan78's topic in Javascript Help
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. -
In your original code you had How did you know what the variables were?
-
Make HTTP GET request with cURL from Wowza Rest API
Barand replied to Texan78's topic in PHP Coding Help
At what point is $obj->isConnected converted to a string? -
I guess you need to give it over 2 seconds of actual work to do
-
Make HTTP GET request with cURL from Wowza Rest API
Barand replied to Texan78's topic in PHP Coding Help
json_decode -
Plotting dynamic markers from MySQL DB in Google Maps
Barand replied to Texan78's topic in Javascript Help
You didn't look at the code samples in that thread then? -
->setCellValue('F'.$i,$row['prod_sell_override']>0 ? $row['prod_sell_override'] : number_format($row['prod_trade']*100/70), 2) ?
-
Setting field to unique per user and not column
Barand replied to learningprobs's topic in MySQL Help
You would lessen the load by putting an index on the user_id column. -
Have you tried number_format()?
-
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
-
Plotting dynamic markers from MySQL DB in Google Maps
Barand replied to Texan78's topic in Javascript Help
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