[Solved] How to run a query with the values of a windows open PHP

If you send data using GET method within your url you should update your query in main.php getting: $day = $_GET[‘year’]; $month = $_GET[‘month’]; $year = $_GET[‘day’]; $sql = “SELECT HoraIni,MinutoIni,HoraFim,MinutoFim,CdCurso,NmCurso,DgTpMarcacao FROM marcacaosalas Where Data=”$year-$month-$day””; Anyway i dont understand why you don’t easly send the whole data to the page simpli using a fomith a … Read more

[Solved] php cURL undefined index

According to data flile you provide some of elements doesn’t include ‘platform’ property (see examples downhere). So use techniques I sugessted before: $platform = (isset($locations[‘platform’]))?$locations[‘platform’]:”; You should verify if property exists before use it. code: foreach($result_arr[‘locations’] as $locations){ $platform = (isset($locations[‘platform’]))?$locations[‘platform’]:”; echo ‘== PLATFORM : ‘.$platform.’ <br />’; } outputs: == PLATFORM : 7 == … Read more

[Solved] how to output google script with php

Use a heredoc: $this->output(<<<EOF <script> (function() { var cx = ‘011900192141920744246:n9jj1rxodww’; var gcse = document.createElement(‘script’); gcse.type=”text/javascript”; gcse.async = true; gcse.src = (document.location.protocol == ‘https:’ ? ‘https:’ : ‘http:’) + ‘//www.google.com/cse/cse.js?cx=’ + cx; var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(gcse, s); })(); </script> <gcse:search></gcse:search> EOF ); If this doesn’t work, check your output function. 0 solved how to … Read more

[Solved] Flattening of multidimensional table in PHP

Try this: function flatten_array($data) { $newArray = array(); foreach ($data as $key => $value) { if (is_array($value)) { $newArray[] = ‘Start’ . $key; $newArray = array_merge($newArray,flatten_array($value)); $newArray[] = ‘End’ . $key; } else { $newArray[$key] = $value; } } return $newArray; } $flat = flatten_array($data); print_r($flat); output: Array ( [one] => one [0] => Starttwo … Read more

[Solved] Highcharts column graph colors via sql data

And I had finally figured out how to make it work colors: [ <?php $num_counts = count($count); $on = 1; foreach($count as $bit => $bit_counts) { if($bit == ‘STEEL’){echo”‘#FF9999′”;} else if($bit == ‘STEEL CROWN’){echo”‘#FF9999′”;} else if($bit == ‘SLIM’){echo”‘#9999FF'”;} else if($bit == ‘KYMERA’){echo”‘#FF2626′”;} else if($bit == ‘HYBRID’){echo”‘#FF2626′”;} else if($bit == ‘EZC’){echo”‘#FFFF26′”;} else if($bit == ‘EZR’){echo”‘#FFFF26′”;} else … Read more

[Solved] Need a help in Inserting data of nested checkboxes into database as given in the below image.how to save days and it’s timing in an array in php

Need a help in Inserting data of nested checkboxes into database as given in the below image.how to save days and it’s timing in an array in php solved Need a help in Inserting data of nested checkboxes into database as given in the below image.how to save days and it’s timing in an array … Read more

[Solved] Add “.”(dot) in a Numbers [duplicate]

See the number_format function, $number = number_format($number, 0, ”, ‘.’); // change 70000000 to 70.000.000 etc. // ex. with a number set $numbers = array(70000000, 75000000, 300000); foreach ($numbers as $number) { echo number_format($number, 0, ”, ‘.’) . ‘<br>’; } solved Add “.”(dot) in a Numbers [duplicate]

[Solved] How to make a link this is connected to database in php

I agree with Marcosh (in the comments), so that would give you this code (between the if(…) { and } else): echo “<table><tr><th>ID</th><th>Name</th><th>Phone Number</th><th>Country</th><th>Email</th><th>Send SMS</th><th>Link to page</th></tr>”; // output data of each row while($row = $result->fetch_assoc()) { echo “<tr><td>” . $row[“id”]. “</td><td>” . $row[“firstname”]. ” ” . $row[“lastname”].”</td><td>” . $row[“phonenumber”]. “</td><td>” . $row[“city”]. ” “. … Read more

[Solved] Using R, how to reference variable variables (or variables variable) a la PHP

Consider using get() to obtain environment variables from string values. Additionally, consider the nested lapply() between dataframe and model lists for more organized returned object. Nested for loops would require appending each iteration into growing list unless you just need to output. Below examples use linear models, lm(): model1 <- y ~ x1 model2 <- … Read more

[Solved] Call to member function setDate() on string

You can use t in format specifier on DateTime‘s format function. date format specifiers format character: t Description: Number of days in the given month Example returned values: 28 through 31 <?php $input=”2017-08-28 10:50:30″; $date_time = DateTime::createFromFormat(‘Y-m-d H:i:s’, $input); $last_day_of_month = $date_time->format(‘Y-m-t H:i:s’); echo $last_day_of_month; This gives: 2017-08-31 10:50:30 Demo: https://eval.in/844314 0 solved Call to … Read more

[Solved] How to hide files in a website

Your download.php file is just setting some headers to tell the browser to download the file. It doesn’t actually write the content of the file in the response. You just have to add the following line of code to the end of download.php: readfile($_SERVER[‘DOCUMENT_ROOT’] . “/content/files/pdf2.pdf”); NOTE: As gview mentioned in the comments, the proper … Read more

[Solved] Setting a PHP cookie value to be intentionally vulnerable

i looked at it again, try this: $cookie_name=”Authenticated”; // this checks if the value has been set already if (!isset($_GET[‘cookie_value’])) { // if no value is set, it defaults to 0 and displays the error message $cookie_value=0; $error = “You are not authorized to view this page!”; echo $error; } // Now here if the … Read more