Questions tagged as 'php'

2
answers

Single database instance

I have a controller and need to access 2 or more tables from my database, eg: $userModel = loadModel('userModel'); $userModel->setTable('users'); $userModel->getAllUser(); $outroModel = loadModel('outroModel'); $outroMode...
asked by 23.05.2014 / 20:43
1
answer

PHP Mailer or postfix redirecting to gmail?

I have a Ubuntu server (LAMP) and I need to send emails via PHP, however using my account in gmail, I do not want to have an email server of my own. I need to set one of two ways below to do this: 1 - Install postfix to redirect to my gmail...
asked by 15.09.2014 / 07:52
1
answer

How to save the IP of who visited my site in a text file?

I'm using the code below, but it only writes ":: 1" to the file. <?php $arquivo = "ips.txt"; $file = fopen($arquivo,"a"); $string = $_SERVER['REMOTE_ADDR'] . "\n"; $fp = fwrite($file,$string); fclose($file); ?> Is it because I'm on...
asked by 09.09.2014 / 18:19
1
answer

Avoid double-click and redirect to another page

Good afternoon! I made a function to prevent the user from pressing twice on the same button, this part works perfectly. global.js $('.form-disable').on('submit', function(){ var self = $(this), button = self.find('input[type="submit"], b...
asked by 22.06.2018 / 15:34
1
answer

Pass a button's id inside a while (in php) to a code in java script and start the id inside a modal

I have two buttons in a table that stays within a while (in the php code) and I have a modal outside of that while structure. My question is how can I get the individual id inside my table that is inside the loop repeat and play in the input fie...
asked by 22.06.2018 / 16:18
1
answer

Group similar elements of an Array in PHP

I'm working on a project for my company where I need to group elements of an array that have values in common. My array is as follows: Array ( [0] => stdClass Object ( [strRespAciona] => ALDREYACI [str...
asked by 12.06.2018 / 20:25
1
answer

PHP min ($ footage) bringing the wrong value

I have a $ variable variable that var_dump brings me: array(5) { [0]=> string(5) "111,5" [1]=> string(2) "81" [2]=> string(4) "90,8" [3]=> string(4) "79,6" [4]=> string(1) "6" } I want to bring the minimum...
asked by 15.06.2018 / 16:30
1
answer

Pass two variables in the url in javascript

I have a website that has 5 different languages and when choosing a language the text of the page changes! For this I did a function: <script type="text/javascript"> function submitForm() { var thelang = document.getElementById('lang...
asked by 15.06.2018 / 14:14
1
answer

is there any function in javascript, php or xml to hide or block buttons from the title bar of nagedores

I am making a page to validate an item but I would like this page to only close if the scanned item is right until it works, but can not find any code to hide or block the buttons in the title bar of the browser windows because I would like the...
asked by 14.06.2018 / 21:19
1
answer

What are the advantages of using sprintf instead of concatenating strings?

I know the sprintf function is for formatting strings and can replace concatenation. I can see one advantage: readability. But the other advantages I can not see. Besides readability (due to separation), what are the other advantages of...
asked by 05.10.2018 / 16:14