Posts by Ricardo Rosa • 179 points
16 posts
-
0
votes1
answer31
viewsA: How to delete an element specific to <select>? (Javascript, Jquery)
Experiment with the function like this: function removeAdmin(){ let opcaoSelecionada = $('.adminEdit').find(":selected"); // aqui vai buscar o elemento if(opcaoSelecionada &&…
-
4
votes3
answers1237
viewsA: How to insert a new line in the json file, using PHP?
You can do it this way // extrai a informação do ficheiro $string = file_get_contents("config.json"); // faz o decode o json para uma variavel php que fica em array $json = json_decode($string,…
-
2
votes4
answers1156
viewsA: Login condition with user or email in the same field
In your query try to do this way $sql = "select * from professor where (login= :email or login= :usuario) and senha= :senha"; There is no condition OU the condition you must use is OR…
-
2
votes2
answers541
viewsA: Cutting strings from right to left
You can do it this way $codigo = ""; $cod = 4444; if($cod != ""){ $anoAgora = substr(date("Y"),2,2); $ano = substr($cod,0,2); $num = substr($cod,2,5); $numInt = intval($num); if($anoAgora != $ano){…
-
1
votes1
answer20
viewsA: How to change the date 2017-07-04 12:53:14 to Day/Month/Year with PHP
You can format like this date_format(date_create("2017-07-04 12:53:14"), "d/m/Y H:i:s");
phpanswered Ricardo Rosa 179 -
0
votes1
answer499
viewsA: How to disable page caching
There is a very simple way to bypass browser caching, if you change the image name the browser will "think" that it is a new image and does not cache the old one. Another option is in the file…
-
0
votes1
answer169
viewsA: Displaying wordpress posts with Curl
Do so: $ch = curl_init(); $url = 'http://www.hospitalpadreze.org.br/noticias/wp-json/wp/v2/posts?per_page=2'; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); //…
-
0
votes1
answer66
viewsA: how to mount the json of that call
Do so: $array = [ "auto_recurring" =>[ "frequency" => 1, "frequency_type" => "months", "transaction_amount" => 200 ] ]; After you want to convert to json do the following:…
-
0
votes1
answer88
viewsA: Returning XML files inside a PHP folder
You have to add exection to these two directories this way. $pasta = $data[0].$data[1].$data[2]."_".$data_end[0].$data_end[1].$data_end[2]; $l_nfe = dir("xml/".$pasta); while($arquivo = $l_nfe ->…
-
0
votes1
answer56
viewsA: How to format the appearance of a link on social networks?
You can see here all the documentation on this subject: http://ogp.me/ The most normal options to use are these: <meta property="og:title" content="Titulo que deseja" /> <meta…
-
0
votes1
answer126
viewsA: Remote Connection to DBA MYSQL + PHP
You need to add your IP to the list of remotes allowed to connect to that database. If the control panel is cPanel is in this icon:…
-
1
votes3
answers77
viewsA: Problems when generating schedules dynamically
Do so I converted first to minutes, to facilitate the process. $start = self::horasToMinutes('08:00'); $end = self::horasToMinutes('15:30'); $dif = $end - $start; for($i = $start; $i <= $end; $i…
phpanswered Ricardo Rosa 179 -
-1
votes3
answers336
viewsA: Repeat loop json php mysql
Try this way. <?php header('Content-Type: text/html; charset=utf-8'); if($_SERVER['REQUEST_METHOD']=='POST') { require_once("dbConnect.php"); // Definir UTF8 mysql_set_charset($con, 'utf8');…
-
1
votes1
answer40
viewsA: Searching for existence of registration before including a new one (Yii 2)
Try it like this <?php use yii\helpers\Html; use app\models\ANOLETIVO; /* @var $this yii\web\View */ /* @var $model app\models\ANOLETIVO */ ?> <?php $this->title = 'Iniciar Ano do…
yii2answered Ricardo Rosa 179 -
0
votes1
answer155
viewsA: Where part of Yii2 I connect to the database
The file that should declare database connection is main-local.php The print below shows the exact place where it is. Inside the file you should find something like this. 'components' => [ 'db'…
-
1
votes1
answer599
viewsA: How to pass an array in php’s Query function?
You can use this function is simpler. function insertBD($array, $tbName){ $variavel_insert_colunas = ""; $variavel_insert_valores = ""; $count = count($array)-1; $i = 0; foreach ($array as $key…
phpanswered Ricardo Rosa 179