[Solved] PHP – Showing different text between different dates (3 Different Text to be shown)

Hello Akshat please find the simplified solution below <?php $current_date = date(‘Y-m-d’); if(strtotime($current_date)>strtotime(‘2015-01-01’) && strtotime($current_date)<strtotime(‘2015-04-01’)) { echo “TERM 1”; } elseif(strtotime($current_date)>strtotime(‘2015-04-20’) && strtotime($current_date)<strtotime(‘2015-06-01’)) { echo “TERM 2”; } elseif(strtotime($current_date)>strtotime(‘2015-07-01’) && strtotime($current_date)<strtotime(‘2015-10-31’)) { echo “TERM 3”; } ?> I have tested it and its working fine 1 solved PHP – Showing different text between different dates … Read more

[Solved] Warning: strtotime() expects parameter 1 to be string

Introduction The “Warning: strtotime() expects parameter 1 to be string” error is a common issue encountered when working with PHP. This error occurs when the strtotime() function is used with an invalid parameter. The strtotime() function is used to convert a string representation of a date and time into a Unix timestamp. This error can … Read more

[Solved] #document in Object [closed]

Your developer tools are showing you the content located at the relative URL http//img.youtube.com/vi/$youtube/0.jpg (which is a blank HTML document). You are missing a : and should be using an <img> rather than an <object>. solved #document in Object [closed]

[Solved] Empty query no matter what

You need to fix the backticks and quoting on your query. You have – $sql=`SELECT * FROM PRICES WHERE TES LIKE “%” . $TES . “%” `; It should be – $sql=”SELECT * FROM PRICES WHERE TES LIKE ‘%” . $TES . “%’ “; You should only have to check for a query error once … Read more

[Solved] Buttons are not appearing at top right

Add this css it will float on right side: .pull-right { float: right!important; margin-top: -66px; position: absolute; margin-left: 293px; } Working fiddle:http://jsfiddle.net/cpf78jsg/1/ 11 solved Buttons are not appearing at top right

[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