Posts by ShutUpMagda • 2,056 points
86 posts
-
0
votes2
answers232
viewsA: Doubt with set value (codeigniter)
Are you dealing with the method of the library, and it has its own requirements: form_dropdown([$name = ''[, $options = array()[, $Selected = array()[, $extra = '']]]]) In the documentation there…
-
1
votes1
answer432
viewsA: Problems to generate PDF with mPDF
First you need to understand that not all attributes CSS are supported by mPDF. It is necessary to verify in the documentation the types of tags/properties the library supports. Markups in your…
mpdfanswered ShutUpMagda 2,056 -
0
votes2
answers429
viewsA: How do I receive and submit data without refreshing the page?
To be clear: This is not a tutorial. You need to be familiar with the framework methodology. The code proposed in this answer basically makes a request $_POST pro method json/index passing the data…
-
0
votes1
answer212
viewsA: Generate PDF file with footer only on the last page using mPDF v 5
It is enough to instantiate the method SetHTMLFooter() afterward of WriteHTML(), as in the code below: <?php require_once '/usr/share/php/mpdf/mpdf-5.7.4a/mpdf.php'; $mpdf = new \Mpdf(); $html =…
-
2
votes3
answers170
viewsA: Generate random value with formatting
With php: <?php $hash = strtoupper(md5(date("d/m/Y H:i:s"))); $hash = substr($hash,0,9); //Corta a string para 9 digitos; $hash = substr_replace($hash, '-', 6, 0 ); //Insere o sinal na posicao…
-
1
votes1
answer499
viewsA: Progressive Chronometer Updating div
html chronometer. <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Index</title> <script…
phpanswered ShutUpMagda 2,056 -
1
votes1
answer955
viewsA: Mpdf in codeigniter
First, note that the configuration item $config['composer_autoload'] setado to TRUE will only upload libraries within application/vendor. That implies, at the very least, that there is a…
-
1
votes2
answers120
viewsA: Session Codeigniter PHP
This is related to Session Preferences. You have to tell the application in what context it should manage/read session data. The documentation says the configuration options cookie_domain and…
-
1
votes1
answer212
viewsA: Create Codeigniter html components
Yes, use templates is good, and there’s an excellent answer here. But the use of templates for views does not properly implement components HTML. Follow the guidance in the indication and add the…
-
1
votes1
answer951
viewsA: How does csrf-Protection work in Codeigniter?
1. csrf Protection is only used for requests in forms? No. The very documentation says it serves for any request that is not a GET-HTTP: Codeigniter provides CSRF Protection out of the box, which…
-
0
votes1
answer156
viewsA: How to load two tables in a single select (html)?
If I understand correctly, you want to merge the data from the table of individuals with the data from the tables of legal persons within a single element select. Nor will I make observations…
-
1
votes1
answer108
viewsA: How do I automatically delete flash_data message after it is displayed in codeigniter
It is not necessary. A documentation informs that this type of data is self-destructed (Below, excerpt from the documentation, in free translation): Coedigniter supports "flashdata", or session data…
codeigniteranswered ShutUpMagda 2,056 -
3
votes2
answers3720
viewsA: How to align radio button and label with Bootstrap 3.x?
If by "misalignment" you mean the elements are not on the same line that the label, then what you seek is class radio inline of Bootstrap v. 3.3.x. Use the . checkbox-inline or . radio-inline…
-
1
votes1
answer565
viewsA: How to instantiate an object in Hooks to use in the Codeigniter Controller?
If you need a class that serves methods in all instances of the application, then you should use a library. At least one helper. The hook is the very extent of Core of Codeigniter, I mean, he’s the…
codeigniteranswered ShutUpMagda 2,056 -
2
votes1
answer344
viewsA: How to translate JS plugins dynamically with Codeigniter?
In many systems I have noticed that there are global variables in JS that are placed in the head with the translations. There is a technique to work with thereby? Make it clear: This is not a…
-
1
votes2
answers906
viewsA: What’s the best way to call files?
His basic idea of conditioning by the name of controller is correct (in my opinion), but the execution can be improved. Use file_helper.php to help execute the task. It’s relatively simple: extend…
-
1
votes1
answer62
viewsA: Including the same content for several pages
Include will not work with <?=. That one tag is a shortening of echo in the PHP. If you don’t want to print anything, use <?php, and not <?=.…
-
2
votes1
answer2162
viewsA: Select(combobox) Dynamic
My suggestion: As his select will use pre-registered data do this without request. The simple creation of a checkbox should not require multiple requests and queries to the bank (is what I think).…
-
2
votes1
answer418
viewsA: Popover Boostrap 3 - Does not appear
To documentation informs that such a mechanism (popover) is not automatic. You need to instantiate / initialize (see Opt-in Functionality). In the snippet below you will see…
-
3
votes1
answer1809
viewsA: Clear form data if there is "refresh" of the page?
Change the request headers with header and tell the browser to save nothing in cache: <?php header("Expires: 0"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");…
-
1
votes2
answers691
viewsA: Problems capturing input when opening modal
Note the correct way to call the event. If the case is to fire while showing a new modal, right is shown.bs.modal: $(function() { $('#myModal').on('shown.bs.modal', function (e) { var var_tipo =…
-
1
votes1
answer141
viewsA: Carousel bootstrap one inside the other doesn’t work right
From what I could see in the development repository here, here and here, the framework no support for this. Some people have managed to do things like this here:…
-
2
votes3
answers1150
viewsA: Handling Foreign key errors in Codeigniter
After editing the question became clearer, and the answer is simple: there’s no way to treat this mistake the way you want it. The way you make the mistake is already being treated. Think: there is…
-
3
votes3
answers1150
viewsA: Handling Foreign key errors in Codeigniter
This is a problem with your database configuration. Modeling is an important thing to avoid these things. This and knowing the application documentation. Mysql does this to prevent data integrity…
-
0
votes1
answer85
viewsA: Pass value to 2 different paths
Sending the same data to two or more requests simultaneous in the same click: <script> $(function () { $("#visualizar").click(function () { var id = $(this).attr('data-id'); var url1 = '<?=…
-
1
votes2
answers7202
viewsA: How to create and access a global variable with PHP and codeigniter
From what I understand, it’s not about creating another "global variable", is a function that reads the SESSION, that is already global. Whenever you need to create a function (or method) that must…
-
2
votes3
answers1895
viewsA: how to call a php function through ajax?
how to call a php function through ajax? Answer: The ajax does not call the function itself, it just makes the request for the script logout.php. The script PHP is that it should instantiate the…
-
1
votes2
answers644
viewsA: Active class in the include menu
Do the php menu. thus: <?php /** * Verifica o script ativo e compara com $script indicado; * Se a comparação for positiva, imprime a CLASS; * Se a comparação falhar, retorna FALSE. * @return…
-
0
votes3
answers2210
viewsA: How to display the value of a variable in a modal bootstrap with PHP?
testing.php: <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Example</title> <link rel="stylesheet"…
-
3
votes3
answers2169
viewsA: Control of séssions and authentication in PHP with Codeigniter
Enable the HOOKS in your application. This mechanism will automatically check and validate the logon without having to mark or do includes. Use SESSIONS. I know the native session library of…
-
0
votes1
answer306
viewsA: Problems with modal bootstrap
If you use data-target=".bs-example-modal-sm", then everything that has this class will be fired. In your case, all modals have this class. Instead, prefer to use ids: data-target="#modal<?php…
-
1
votes3
answers28262
viewsA: Update DIV Automatically (autorefresh) without updating whole page
Update a div automatically every 3 seconds using HTML and JavaScript without updating the whole page: $(function() { setTime(); function setTime() { var date = new Date().getTime(); var string =…
-
2
votes2
answers2840
viewsA: Page number on all mpdf pages
I know it’s been a long time since the question was asked, but it’s worth noting: In double-sided documents, you need to define different statements for footers and even-odd page headers; In simple…
-
3
votes2
answers980
viewsA: How to find (and capture) the user running PHP?
I figured it out. You can do it using: $uid = posix_getuid(); $userinfo = posix_getpwuid($uid); print_r($userinfo); Or: print posix_getpwuid(posix_geteuid())['name']; Source: How to check what user…
-
1
votes2
answers980
viewsQ: How to find (and capture) the user running PHP?
I know the command phpinfo() return that: But I want to know if there is any way to capture this information (user/group) in a variable.…
-
2
votes2
answers972
viewsA: Point to a folder before DOCUMENT ROOT?
The server would not "point" to the directory, after all, it would not be public. But you can upload private content to a script PHP. Define a constant and do a kind of "access validation" in the…
-
0
votes1
answer913
viewsA: Export CRUD list with MPDF + Ob_start()
I’ll explain the idea to you, you leave here and make whatever adaptations are necessary in your code. Here’s the basic recipe for our algorithmism: Show the data and the FORM filtering and…
-
3
votes2
answers1982
viewsA: How do I find out the current version of codeigniter?
Use: echo CI_VERSION;. This constant is defined in system/core/CodeIgniter.php. Source…
codeigniteranswered ShutUpMagda 2,056 -
4
votes1
answer5346
viewsA: Progress bar track mysql query execution
Instead of the progress bar, I’ll suggest what I did. It’s simpler, and it doesn’t demand multiple requests from the server. Basically: show a modal with a warning during the execution time of the…
-
0
votes1
answer552
viewsA: Problem with modal registration form
Update when closing the modal: <script type="text/javascript"> $(function(){ $('#myModal').on('hidden.bs.modal', function () { window.location = window.location; }); </script>…
-
1
votes1
answer304
viewsA: Ajax canceling onblur and onfocus events
First of all, remember correct library loading order. If you carry bootstrap.min.js before jquery.min.js, is wrong. That’s the way it is: <script…
-
1
votes1
answer566
viewsA: View fullcalendar codeigniter events
Model method that captures db data: function obter_noticias() { $sql = "SELECT * FROM noticias ORDER BY noticias.data ASC"; $query = $this->db->query($sql); $array = $query->result_array();…
-
1
votes1
answer948
viewsA: Save data from a query to an array and display via Jquery
You must know JQuery. You have to know at least the syntax of the language (JavaScript) and the library. You need to know that to reference an element, you must use a selector. Behold: $('#form') is…
-
1
votes2
answers676
viewsA: Repeat data from a row in the modal table
Very simple: pass a unique ID to the data-target (or for the href) of modal: data-target="#myModal<?=$usuario["id"];?>" And each modal must have the same id:…
-
4
votes1
answer1287
viewsA: Pull php echo into a div, no refresh
Send the data from form without refresh and with "validation"; Captures the response of php in resp and fills the div; Shows refresh button to renew the form <script> $(function () {…
-
1
votes2
answers131
viewsA: Keep client logged in to http and https
Store all user data on $_SESSION. It will be available in any instance regardless of encryption. Load the Session Library in scope or with autoload. I’ve already made one helper who received the…
-
2
votes2
answers427
viewsA: Codeigniter 3 send file with extension PFX
This error occurs because the framework is not finding this extension in the list of mime types, I mean, he doesn’t know what it is or how to handle a file .pfx. To solve, open up config/mimes.php…
-
1
votes1
answer855
viewsA: Search field/data filter
As for security, it’s good to take into account what the developer says: Escaping Queries. So I recommend adopting this here: $de = $this->db->escape_str($this->input->get('de')); $ate =…
-
2
votes2
answers136
viewsA: Help me with the error "Undefined index: referrer in "
Change the variable declaration: if($_GET['referrer']){ $referrer = strip_tags($_GET['referrer']); } else{ $referrer = NULL; } So when the $_GET is not sent, the error will not appear, because the…
-
3
votes1
answer258
viewsA: Different responsiveness between browsers (Webkit & Mozilla)
Meta tag viewport. It gives the browser information on how to control the page dimensions regardless of the browser (or device used). <head> <meta charset="utf-8"> <meta…