Posts by Roberto Giffone • 356 points
28 posts
-
0
votes2
answers119
viewsA: How to use 'Else if' correctly?
Peter missed only == on his if E. Instead of comparing with == you were assigning with the =. Follow code below with correction. function min(a, b){ if(a<b){ return a; }else if(a == b){…
-
1
votes2
answers133
viewsA: Catch last grouped Mysql record per year
If you want to take the biggest teaching step of each academic year the query is this. SELECT ano_letivo, MAX(etapa_ensino_id) etapa_ensino_id FROM estudantes_carga_horaria GROUP BY ano_letivo ORDER…
-
1
votes1
answer51
viewsA: Place the function output
The error is in your calculator methodImc which takes 2 parameters and you are not passing. It has two solutions. The first Replace in your display method: $this->calcularImc for…
-
2
votes3
answers285
viewsA: html/javascript clock does not appear
Adjustments made Missed them () for Function and put the lowercase r, as it is a best practice Function starting with lowercase letter and you are also calling in the onload with lowercase letter.…
-
3
votes3
answers4418
viewsA: Error in a simple SELECT with Group By - SQL Server
Every field that returns in the query without functions like SUM, AVG, etc must be in the group by Example: SELECT P.Nome,P.TipoId,SUM(P.QuantidadeMensal) AS total FROM StockPhotos.Pacote P GROUP BY…
-
1
votes1
answer43
viewsQ: Facebook API - Extract URL from facebook fan page cover photo
Good afternoon. I’m starting to study the Facebook API and I’m having a hard time getting the URL of some fan page cover photo. I’m unable to assemble the get to bring me the desired information. As…
-
0
votes3
answers670
viewsA: Alert Ao Enviar Email com Sucesso
You can insert the message in the PHP session Your index page should be php and not HTML. //Página mail.php antes do header('Location: index.html'); $_SESSION['msg'] = 'E-mail enviado com sucesso';…
-
0
votes3
answers48
viewsA: Syntax error concatenation
In javascript the concatenation operator is +. Just replace the . by + as below. function setarRegistro() { campos = "teste="+encodeURI(document.getElementById('teste').value)+…
javascriptanswered Roberto Giffone 356 -
0
votes4
answers1088
viewsA: Add Word Links to a Text
You can create a javascript function to open a new tab and receive the word you want to translate. function abrePagina(palavra){…
-
0
votes1
answer42
viewsA: SQL connection to PHP
According to the Microsoft website it is necessary to include in php.ini as below. Extension=php_sqlsrv_72_ts.dll Reference:…
-
0
votes2
answers379
viewsA: SQL connection with PHP does not find the Drivers
The Microsoft website explains what is required for connecting to SQL Server. Probably missing you include the extensions in your php.ini The file gets in the same way as your dlls. The step by step…
-
-3
votes2
answers89
viewsA: How to search for the selected value in Mysql/PHP and HTML?
In the case of your example the name of your page has to be temp.php. Because the way you’re doing will make the request to own page. I took into account that the status will always have value…
-
1
votes4
answers1386
viewsA: Take <span> value with PHP
Paul you can put an id in span to get the value of it. <!--No HTML--> <span id="mySpan">Conteúdo do meu span</span> //No javascript document.getElementById("mySpan").innerHTML; To…
phpanswered Roberto Giffone 356 -
2
votes1
answer33
viewsA: How to show the seconds running in the date function
You can do via jquery by picking up the client’s time. <!DOCTYPE html> <html> <body> <p>A script on this page starts this clock:</p> <p id="demo"></p>…
-
2
votes1
answer39
viewsA: Callback is executed in the parameter
You need to set ajax to asynchronous false. async: "false"
-
0
votes1
answer90
viewsA: Javascript - How to "block" access to a website and unlock it if the user likes a particular facebook page or waits a certain time?
You can record the ip of the user who liked in the database of your application and if you access again you will not be able to like again, because will bar by ip. I don’t know what server language…
-
0
votes1
answer46
viewsA: Chat using php and msql
The ideal is for you to pick up by the user. And the same should be unique so that there is no duplicity. Place the field as UNIQUE in your database and in the application before inserting a new…
-
1
votes1
answer92
viewsA: Image Generator
You need to take the parameters by get and assign the HTML img tag. For example. If your page is this "image.php? src=logo&width=600&height=600" the code will be: <img src="imgs/<?php…
phpanswered Roberto Giffone 356 -
0
votes2
answers49
viewsA: Does not return the table
Your include is missing the php file extension. Try inserting the extension and try again.
-
0
votes2
answers81
viewsA: HTML preview showing the first element
You need to change the Function and change your preview id. So the htmls tags you type will be interpreted as such. function showPreview() { var value = $('#copy').val().trim();…
-
1
votes1
answer41
viewsA: Site content disappears when placing accents
Tries to place the external js file call with utf-8 <script type="text/javascript" src="*.js" charset="utf-8"></script>
-
1
votes2
answers597
viewsA: error: failed to open stream: No such file or directory in
It is more recommended to use the function below for autoload. The names in file_exists will depend on the folders that your class files are in. I only considered your classes folder.…
phpanswered Roberto Giffone 356 -
1
votes3
answers430
viewsA: Loop Usage within the Append Function
I believe that’s what you want. Just include the desired HTML $(function(){ var apresentacao = ["meu nome", "meu nome 2", "meu nome 3"]; for(i=0; i < apresentacao.length; i++) {…
-
0
votes2
answers54
viewsA: PHP - Session variable does not display new content
In the example you quoted here is appearing. If this problem is occurring in your system check if it is some part of the code is assigning the empty NULL or ""value to the session. And make sure…
phpanswered Roberto Giffone 356 -
0
votes2
answers29
viewsA: Postage slab and exceptional
Make sure you do what you need. $peso = 61; $valor = 0; while($peso != 0) { if( $peso >= 30) { $peso -= 30; $valor += 20; } else if( $peso >= 3){ $peso -= 1; $valor += 6; } else if( $peso…
phpanswered Roberto Giffone 356 -
0
votes3
answers139
viewsA: Problems with Ajax in PHP MVC project
Have you checked if the click event is being triggered? Try printing some static text below the click event to check if you are triggering the event. $(".form-response").on('click',function(e){…
-
0
votes1
answer110
viewsA: Login with PDO does not check number of select results
It is necessary to check the return. //Pode usar o var_dump ou print_r var_dump($users) print_r($users) I recommend the var_dump
-
0
votes2
answers348
viewsA: php connection to mysql
The mistake points out that his servidor does not exist, you are passing the servidor as servername. The servidor that we use to test is the localhost or ip 127.0.0.1 Example: Your server being…