Questions tagged as 'php'

1
answer

Check if file was created

I made a function that creates a file in php, but I need it to return true if everything worked fine or false if one of the steps failed. I have decided as follows: function createFile($path, $nome, $content){ if (!($fp = fop...
asked by 27.12.2016 / 16:28
2
answers

Concatenate variable in array

I have to request a json for a api , however I have to retrieve data from a form to complement this json , the problem is that by saving the data to a variable I can not put it Correct way within that json , I tried to c...
asked by 04.11.2017 / 20:28
2
answers

Get only one PHP variable from another page with Jquery

To get the contents of a page I use the date, but I would like to know how to get only one variable on another page. I use this code: jQuery(document).ready(function(){ jQuery('.teste').submit( function(){ var teste = $(thi...
asked by 31.10.2017 / 14:53
2
answers

$ _GET get value from ID or name?

Does $_GET , or even $_POST , get ID values from input or name ? <form action="#" method="get" name="meuForm"> <input id="nome" name="nome" type="text" value="Teste"> <input id="email" name="email" typ...
asked by 03.07.2017 / 18:45
1
answer

Send files via FTP with PHP

I have the following code in PHP for UPLOAD of files in PHP and send to an external server via FTP. However, it returns the following error when I do UPLOAD: Warning: ftp_put(): Illegal PORT command. in /var/www/protocolo/teste/envia.php on li...
asked by 05.06.2017 / 16:52
2
answers

How to display the company logo icon in the outlook message box

I have an email trigger code using Zend. $mailTransport = new Zend_Mail_Transport_Smtp($this->smtp_host, $config); $mail = new Zend_Mail('UTF-8'); $mail->setFrom($from['email'], $from['name']); $mail->addTo($to); $mail->setSubject...
asked by 23.06.2017 / 20:26
2
answers

Simple XML Reader: I can not convert nodes to HTML or limit the number of items

I've used SimpleXMLReader to make parse of a gigantic XML structure, that has more than 25mb. My code works normally, however, I have two problems: I can not turn Xpath into HTML . Well, I studied it, and I saw that it's n...
asked by 05.06.2017 / 09:46
2
answers

Calculate expiration date

I have a column named START in DATETIME format in MySQL and I would like to check if each row is expired and / or how many days are left to win that row, taking into account that the row expires in 30 days after the START date . I thought of...
asked by 08.09.2015 / 21:52
1
answer

How to extract only different values from an array?

I am extracting from a array city name. I want to extract cities with different names. In the current case, my script returns several names of equal cities. I want to recover only once each city name. The result is this: Array (...
asked by 03.01.2016 / 02:15
1
answer

When clicking a button execute a php

Is it possible to merge php with jQuery ? For example, when I clicked on a button I would take the value of an input via jQuery and move on to php, an example of what I'd like to do: $('btn').on('click', function(){ <?php // ID de exem...
asked by 22.12.2015 / 02:43