Posts by Leandro Silva Campos • 543 points
47 posts
-
0
votes1
answer54
viewsQ: FETCH_CLASS does not arrow parent class values
I am using FETCH_CLASS to map the classes, but when for example one class inherits another, FETCH_CLASS does not find the attributes of the parent class and ends up creating new attributes class…
-
-1
votes2
answers523
viewsQ: File encoding in ASC II
I am developing a php application that generates shipping files to the database and these files have to be with the specifications below: Coding System - Low Platform ASC II - including the file…
-
0
votes1
answer306
viewsA: Generating friendly URL
You can use a . htaccess file at the root of your website as follows: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d…
-
1
votes1
answer117
viewsA: Error tagged with php in Smarty
I found my problem, in case anyone has this doubt in the future the solution I found in my case was to use the Marty’s registerPlugin method which according to the documentation is recommended, and…
-
0
votes1
answer117
viewsQ: Error tagged with php in Smarty
I have a question related to the Smarty 3.1 template engine, I’m trying to use the {php}{/php} tags in the templates and I’m getting the following error: Fatal error: Uncaught --> Smarty…
-
0
votes0
answers27
viewsQ: Query mysql with special condition
I’m having trouble assembling a query with two tables. In my comic I have two tables called disciplines and bulletin, in disciplines have the data of each discipline and in bulletin have the foreign…
-
1
votes1
answer41
viewsQ: save quiz time
I did a survey with php and javascript, it’s all right. There’s just one small detail that I’m not sure which is the best way to do it. The questionnaire has a time to be answered, and I would like…
-
1
votes0
answers24
viewsQ: Images added with tinymce do not respect div
I made a little file upload plugin that is integrated into tinymce, but when I add images through tinymce they don’t respect div. How can I fix this? I saw that tinymce adds fixed pixel sizes, it…
-
0
votes0
answers161
viewsQ: Change user status when online with websockets (php Ratchet)
I’m making a chat using websockets with Ratchet, and I have a question regarding the user status. I made the page upload a list of all the contacts that the user has, and when the server receives a…
-
0
votes0
answers220
viewsQ: Websockets with php Ratchet does not work
People are studying websockets, and when trying to follow several examples found on the internet and on the site of Ratchet itself I just can’t run the server, the terminal is like this: Follow code…
-
0
votes0
answers75
viewsQ: Upload progress bar Amazon S3
I’m using the following code that sends the post with the $_FILE file to a file I called upload.php, which makes use of Amazon’s php sdk. The upload is taking place normally, but I noticed that the…
-
0
votes1
answer46
viewsA: Upload Amazon S3
In case someone needs it, I got in the Amazon documentation information on how to make such restrictions, just add the Bucket policy below in your Bucket: { "Version": "2012-10-17", "Id": "http…
-
0
votes1
answer46
viewsQ: Upload Amazon S3
I’m having a question, I made a small php script to upload files into my Bucket and I need all and any file contained in it to be accessed only through a url. How can I do this? via code or…
-
2
votes1
answer117
viewsQ: added text with append does not respect div
I have a list that your elements are added with the jquery append and the added text does not respect div and list boundaries: css: #list_arquivos{ list-style:none; } #list_arquivos .arquivo{…
-
1
votes4
answers252
viewsQ: css does not work with div added with append
I have a list and in it I add the elements with jquery append , and the list elements do not capture the css of my style file, just ignore it. Because? html: <ul id="list_arquivos"></ul>…
-
0
votes1
answer43
viewsQ: Unwanted characters using jquery + php
I have a small problem, when I use the jquery append to display elements returned from a php query. Note: this is not the full append, it is a little extensive and I put only the part I need you to…
-
1
votes2
answers70
viewsQ: find input value does not work
I have a list that incremented dynamically with the jquery append, the list goes like this: $("#questoes").append( '<li class="questao" data-id="'+questao+'">'+ '<div class="row…
-
2
votes2
answers1166
viewsQ: Array to store input values that are inside a li
I’m having trouble making an array in jquery with "each" to save the input values contained within a list, in the following format: Note: In the list of questions, each question has a sublist with…
-
0
votes1
answer535
viewsA: Date Picker does not appear
Well I don’t know how your modal is, but you can do so. <!-- Button to trigger modal --> <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>…
-
1
votes2
answers244
viewsA: Tinymce does not work with append
I was able to solve by creating a function containing "tinymce.init" and every time I add a textarea, I use the function to load the editor: $(".nova_questao").click(function(){…
-
1
votes2
answers244
viewsQ: Tinymce does not work with append
When I add a direct textarea to html tinymce works, but with jquery append, so: $(".nova_questao").click(function(){ $(".questoes").append( '<div class="questao">'+ '<h4 class="h5">1.…
-
0
votes0
answers18
viewsQ: About integrity in bd mysql
If I set in bd the foreign keys and activation "Cascade" according to the use of delete and update events, I need to do this at application level too?
-
0
votes2
answers436
viewsQ: Click action with jquery does not work with duplicate items
I have two buttons on my page that serve to delete users, one I put at the top of the table where displays users along with paging and the other at the bottom, also along with paging. I put so to…
-
1
votes2
answers63
viewsQ: Optimization of database model
I’m making a system for a college and one of the subsystems that I’m building is the student report card. I put for when creating a new discipline in the "discipline" table this discipline is added…
-
0
votes2
answers144
viewsA: Collapse in bootstrap 4
I was able to solve using a jquery selector type, to select all elements with the class "menu_arrow_container" I created to identify where the menu is. $(".menu_container a").click(function() {…
-
0
votes2
answers144
viewsQ: Collapse in bootstrap 4
I wish that when I click on one of the menus Collapse the others hide and I’m not getting, I’m using the following code in jquery, I don’t know if it’s right: $( ".card" ).on( "click",…
-
1
votes1
answer284
viewsQ: BETWEEN with Inner Join does not work
I am having a problem when making a query using between with Internet, the query is simply not working, it returns the results as if the between was not in the query. What I’m doing wrong? SELECT *…
-
0
votes1
answer109
viewsQ: Problem with includes using friendly urls
I’m having a problem that is already driving me crazy, I’m using friendly urls in a system I’m making and the css files,js etc are not loading, I’ve seen several cases here that this happens because…
-
3
votes2
answers946
viewsQ: Encryption with bcrypt + random salt
I have a simple question about encryption using bcrypt with salt. When in old projects I used md5, to check in a login form if the user typed the correct password and authenticate, it was customary…
-
2
votes2
answers1248
viewsA: Sum values returned from while
You can add with an auxiliary variable inside the while: $aux = 0; while($conteudo = $buscar->fetchObject()){ $aux += $conteudo->valor; } $retorno['dados'] = $aux; And at the end of the while…
-
0
votes2
answers292
viewsA: How to recover values from two tables in Mysql
If I understand correctly, you want to relate these two tables. Then you can use the Inner Join in the query, for example: SELECT nome, sobre_nome, foto FROM usuario INNER JOIN post ON usuario.id =…
-
1
votes0
answers75
viewsQ: Automatic Breadcrumbs
How to implement Readcrumbs in php so that they are automatic? Do you have a library that does this? I’ve thought of some ways to do it, but they’re all hideous gambits that I won’t even post here.…
-
2
votes1
answer41
viewsQ: Is my database access function secure?
I have a file that has CRUD operations with PDO and Mysql, my question is if I leave my functions as the function below: function delete($tabela, $id) { global $con; $sql = "DELETE FROM " . $tabela…
-
0
votes2
answers792
viewsQ: login with Cpf or email in php
I have a little problem when making a login system which user should be able to authenticate by your email or Cpf. I am making the comparison with the value of the login field received, if it is…
-
0
votes1
answer214
viewsQ: Mysql connection security using PDO, am I doing right?
It is safe to connect with Mysql only using the following form below? <?php function conectar() { $server = "localhost"; $dbname = "banco"; $dbuser = "usuario"; $dbpass = "senha"; try { $con =…
-
8
votes4
answers2092
viewsQ: Null values in PHP
In PHP 7 which is the correct way to define and identify null values? Which of these is the correct way to assign null? $valor = null; $valor = ""; Which of these is the correct way to identify null…
-
0
votes2
answers220
viewsQ: How to send form but remove null fields
How do I send a form for example via GET or POST, but without sending fields that are null? To make it very clear, I want the form to be submitted even with some empty fields, but that these empty…
-
0
votes0
answers38
viewsQ: Idea for data cleaning and processing library
I need to make a library for data processing, so I can use it before calling functions like: Register, Change, Delete and etc... I am using PDO for communication with the mysql database, and the…
-
0
votes1
answer213
viewsQ: array repeating results
I don’t understand why my array is repeating the results, my loop to go through it is like this: for ($i = 0; $i < count($estados); $i++) { foreach ($estados[$i] as $key => $valor) { echo…
-
2
votes2
answers606
viewsQ: Empty function return
Could someone tell me why my insert2 function is returning null after insertion? she should be returning the string with the success message. <?php require_once 'conexao.php'; $con = new…
-
0
votes0
answers345
viewsQ: Generic crud with phpoo and Pdo (no framework)
I want to make a kind of Generic Crud and I implemented the function of Insert, I know that the way I did is not a better way to do it and I don’t want to use any kind of frameworks and so I would…
-
2
votes4
answers1502
viewsQ: How to inherit more than one class in PHP?
There is the possibility of inheriting two classes in PHP? I have a class that already inherits the class Usuarios and would like her to inherit the class Crud also. class Alunos extends Usuarios {…
-
0
votes1
answer35
viewsQ: Tree b is partitioning the wrong node
I’m having trouble with the b-tree structure, it’s misporting the node and it’s missing some keys. I honestly don’t know what I did wrong. #include <stdio.h> #include <stdlib.h> #define…
-
0
votes1
answer3265
viewsQ: How to get input checkbox array value with jquery
I’m not able to verify if at least one checkbox was checked before giving Ubmit in the form. I saw that you have some questions similar to mine, but none of the solutions worked out for me I used…
-
0
votes0
answers64
viewsQ: Using filter_var() Sanitize with Pdo, do I need to use statements?
I wonder if even using filter_var with Sanitize you need to use Pdo statements. Is it safe to do so? or do I need to use bindValue for example() <?php $con=conectar(); //Recebe número da pagina,…
-
-1
votes1
answer74
viewsQ: Doubt about alternative to decrease code size and make fewer queries
I have a question regarding a certain part of a system that I am developing. The system is for management of a higher education institution and has a page that is to administer the courses of the…
-
2
votes0
answers227
viewsQ: Function . click does not work on mobile
I made a registration form using jquery, and it works 100% on the desktop plus in mobile browsers.click(Function(){' .... below follows an excerpt from my file . js, if someone can give a strength I…
jqueryasked Leandro Silva Campos 543