Posts by RFL • 6,205 points
308 posts
-
1
votes1
answer188
viewsA: Validation with Parsley and Modal window
First you will need to create a file javascript to validate your form with the Parsley, soon after, you will have to use own Parsley to verify whether or not the form has been successfully…
-
2
votes1
answer132
viewsQ: Python multidimensional array
I have a series of data that I would like to organize by title, example; movies = [ 'movie': [ 'legenda' [ 'dub', 'leg', 'nac' ], 'time': [ 1, 2, 3, 4, 5 ] ] .... ] I tried with dict() with list()…
-
3
votes1
answer35
viewsQ: Page in wordpress is being redirected to the site "official wordpress"
I performed the backup of a wordpress site to run locally and perform some tests, but every time I click on visitar o site in the top menu I am redirected to the official website (live). I already…
-
1
votes1
answer963
viewsA: Issue Error: Vanillamasker: There is no element to bind
Your line var tel = document.querySelector("input[attrname=telefone]"); this with the wrong syntax, do as follows. var tel = document.querySelector('input[name="telefone"]');…
-
0
votes1
answer31
viewsQ: Hide all different contents from the selected
I created a javascript code that hides all different Ivs from the value that was selected in select. $(".filter-target").change(function() { var target = $(this).val(); if (target == 0) {…
-
1
votes1
answer462
viewsQ: Filter results with Manytomany relationship in the Aravel
I have 2 tables where there is a relationship, client and content using a pivot table contents_clients, when selecting the contents of the "X" client I can know which contents belong to it, but I…
-
0
votes0
answers55
viewsQ: Relationship with Lucerne
I am trying to create a relationship with the tables of my database using Windows, but with a certain difficulty in logic. I have the tables; content, client and user A user may have several client…
-
0
votes3
answers2215
viewsA: belongsToMany Laravel - find()
The convention for pivots is the name of each table (singular) separated by _ alphabetically. category_post
-
2
votes3
answers2985
viewsQ: Delete file Laravel
When trying to delete an image from a specific directory I get the message that the file does not exist, but consulting the path that the code is running I see that the file does exist, and the path…
-
3
votes2
answers7685
viewsA: Return correct php strtotime date
You need to pass as parameter to the strtotime a string with separator using - (hyphenate) for example; $date = str_replace("/", "-", "28/09/2016"); echo date("Y-m-d", strtotime($date));…
-
2
votes3
answers107
viewsQ: validation of superglobal
I am developing a class to assist multiple upload using the codeigniter and I decided to analyze my code using some online tools. One of them was the code Climate; I noticed that when checking…
-
1
votes2
answers994
viewsQ: How to also treat accented strings and without accents in a LIKE
I’m performing a query where I need to search the data based on the first letter of a string, for example. Accessories; select * from tabela where column LIKE 'a%' However, if I pass some lyrics…
-
1
votes2
answers39330
viewsA: How to make a vertical line
This "code" is actually an HTML markup to create a horizontal line. In PHP there are no functions that render HTML on the page. I believe what you can do is; Create a div, place the border (left or…
-
2
votes2
answers100
viewsA: UPDATE giving error but updates database
Your query is being executed one inside the other: //primeira ocorrência $sql = mysqli_query($conecta,"UPDATE agente SET login_on = '$date' WHERE login_ag = '$login' AND senha_ag = '$senha'");…
-
1
votes1
answer301
viewsA: Slimframework + PHP-View
I found the mistake; The same was in the declaration of path to the archives return new \Slim\Views\PhpRenderer('App/resources/views'); There was one last bar missing / after views. return new…
-
0
votes1
answer301
viewsQ: Slimframework + PHP-View
I did the download library Php-View to use together with Slim Framework 3.x, but I am not able to make the return of view. // Get container $container = $app->getContainer(); // Register…
-
1
votes0
answers45
viewsQ: Install Imagick PHP5.4 centos
I am trying to install Imagick on a centos 5.11 server but so far without success. When I execute: convert --version, I got the message Version: Imagemagick 7.0.1-10 Q16 x86_64 2016-06-07…
-
2
votes4
answers1852
viewsQ: Reference of variable
I am studying PHP and I came across a question of variables by reference and did not understand very well how it behaves. function foo(&$var) { $var++; } $a=5; foo($a); echo $a; // Retorna 6…
-
1
votes1
answer637
viewsA: Eloquent Relationship of Laravel
You can put more than one parameter in the method with, do as follows: $results = Atividades::with('Usuario', 'Tipo')->get(); To confirm you can consult the documentation of the Laravel.…
-
1
votes3
answers1439
viewsA: While inside another While (PHP - SQL)
When you declare in your while($row_busca_forma = mysql_fetch_assoc($Busca_busca_forma) it will only perform once so that the result is equal =, soon...will stop the execution. Try to put a smaller…
-
2
votes3
answers210
viewsQ: Installation Phonegap
After rotating sudo npm install -g phonegap and try to create a project with phonegap create my-app the return of the terminal is this; module.js:340 throw err; ^ Error: Cannot find module…
apache-cordovaasked RFL 6,205 -
1
votes1
answer636
viewsA: Why use session_cache_limiter()
"Cache" is a way to store a value for a faster future query. With the cache we can optimize the loading of the websites and their information. Suppose you have a website that queries in a database…
-
1
votes1
answer74
viewsQ: Redirect Loop Cakephp
I’m maintaining a cakephp system but trying to log in to Brower returns the following error. This webpage has a loop redirect I searched the stack em ingles and found a "solution" that told me to…
-
4
votes1
answer462
viewsQ: Json with relationship Manytomany - Laravel
I created a relationship between my tables using ManyToMany and currently I need to return a Json with the information, but my tables meet this way; // 1. Produtos +-------------+ | id | | name | |…
-
0
votes2
answers119
viewsA: The function I’m calling doesn’t appear, what’s wrong?
windows.location.href is not a method, but a property that will tell you what the current URL of the browser and change the value of this property will redirect the page. window.open() is a method…
-
1
votes1
answer2115
viewsA: Return Json with related data - Laravel
I was able to find the solution in this topic. After creating the relationship in both the controller, models and Migrations; Basically what should be done to fetch the related data is: $dados =…
-
2
votes1
answer2115
viewsQ: Return Json with related data - Laravel
I am creating a REST API but I stumbled upon this issue in which I cannot imagine a solution. In my database I have 2 tables; Table 1 - General product data such as name, code, sku and description…
-
1
votes3
answers441
viewsA: Use variable more times, click Event
you can use the switch to make this operation and make it more legible, try this way. function getData(val) { var option = 0 switch(val.value) { case "option1": option = 1 alert("option…
-
1
votes1
answer48
viewsQ: Grid 960 smaller than the screen
I’m starting to use the 960.Gs system css however I am having some problems related to screen size, please correct me if I am wrong. includes all css files correctly within the header only when…
-
3
votes1
answer256
viewsQ: simplexml_load_string()
I was adding products to my store normally until the images stopped appearing on the front and when I went to see the error log what appeared was: 2015-10-28T11:40:00+00:00 ERR (3): Warning:…
-
0
votes2
answers1052
viewsA: Select PHP in tables with special characters
To search for an exact word and/or that may cause some syntax error in sql use simple quotes around the word, and in your query you are placing dot and comma within the query in; $sql="select * from…
-
3
votes2
answers681
viewsA: Access instantiated class attributes and methods in another class
You can use namespace to use classes in other files. use RaizDaPasta\pastaDaClasse\Classe; Inside your file where you do the use install a new object and use the function you want…
-
1
votes3
answers329
views -
0
votes2
answers310
viewsQ: Page with different layout
I’m starting to develop themes for Wordpress and so far managed to some content and tutorials of how to do such a thing, however the information I have is that: the page page.php is responsible for…
-
0
votes2
answers1118
viewsA: List all form data via POST or GET
You can use the $_REQUEST to pick up all the values and then pass them to the variables; // Usando o laço foreach... foreach ($_REQUEST as $nome_campo => $valor_campo) { //Exibi o campo e o valor…
-
8
votes3
answers477
viewsQ: How to use GIT connected to the server?
I’ve been looking for some time about how I could replace mine filezilla and I got some answers that it’s possible to use git as an intermediary so I can run my site/project according to what’s in…
-
7
votes6
answers10518
viewsA: Difference between php <?php tags and <?=
Yes, when you use <?=... it’s like I’m doing<?php echo... is just an abbreviated way to keep the code cleaner.
-
-4
votes6
answers8335
viewsA: How to know if the form is sent
You can use isset to check if a field has been "sent" or can also use empty. Using isset: $nome = $_POST['nome']; if (!isset($nome)) { echo 'variável vazia'; } Note that before the function isset I…
-
0
votes1
answer170
viewsQ: POST or GET without form
I have a list of items that are being listed in a table normally, but the edit/delete button is outside the rows of each item listed. Doing the conventional way with the button on the same data line…
-
3
votes3
answers415
viewsA: I want to test my test site on my tablet and wanted to know how
You can check the responsive design directly in your Chrome browser without downloading or accessing any specific application: With its open site: Press F12 or right-click and then select…
-
39
votes9
answers31327
viewsA: How to hash passwords safely?
Roughly I (particularly) create a "salt" to concatenate with the hash, a kind of "seasoning", for example; $senhaDoUSuario = 'minhaSenhaFraca'; $salt = 's697er3z1680e6r87er2g35g6514'; //(catwalk)…
-
0
votes2
answers185
viewsA: Hide pdf extension in URL
You can do this by using your file .htaccess RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.pdf -f RewriteRule ^(.*)$ $1.pdf…
-
2
votes2
answers410
viewsA: How to make an SQL query that returns an object instead of an array?
Using PDO do: $result = $con->fetch(PDO::FETCH_OBJ); To display the results print $result->name;
-
1
votes2
answers449
viewsA: Barcode Scanner for iOS, Android and Windows Phone (Phonegap)
There is a post on the website itself phonegap that shows some very useful plugins, and fortunately one of them is what you need! You can find the link accessing this page. or by going to the…
-
2
votes2
answers328
viewsQ: Multiple registration of image
Here I come to ask for your help again! I created a function to register images in the database being one of them the cover and the rest of album images. The script up to register the cover image…
-
2
votes3
answers9083
viewsA: Enable and disable a form edit button - with PHP
Instead of doing if($res > 0) <input type="submit" disabled> else{ <input type="submit"> You can also use the ternary operator by doing as follows. $res = 2; // Exemplo de resultado…
-
0
votes1
answer60
viewsQ: Data passed via Function
I created a function to register images that until yesterday at 18:00 functioned normally and this morning the data of form are not being passed. I can’t believe nobody messed with the code.…
-
1
votes1
answer752
viewsQ: Error loading mcrypt extension: Extension "mcrypt" must be Loaded
I’m trying to install the Gento locally but the same accuses; PHP Extension "mcrypt" must be Loaded. I already installed the curl and the gd but nothing I do to install mcrypt works, I’ve tried...…
-
3
votes2
answers5168
viewsQ: Update with Codeigniter
I am trying to update my database using codeigniter, however the update is not running. HTML: <?php echo form_open('Texto/alterarTexto', 'class="form-horizontal"'); ?> <fieldset>…
-
2
votes2
answers1224
viewsQ: Image Preview with JS
I am trying to make an image preview when the user selects the file with the <input type="file" /> but I’m having a lot of trouble, I’ve looked in several places and as I don’t know much about…