Questions tagged as 'php'

2
answers

Is it correct to concatenate PHP in JavaScript?

I often use this method, but I do not know if it is appropriate, to redeem the id in JS I use echo php <script type="text/javascript" src ="js/jquery.js"></ script> <script type ="text/javascript"> $("document").ready(functi...
asked by 09.01.2016 / 15:24
3
answers

How to create a task scheduler without using cron and without using wordpress

I need to create an automatic method to schedule my email marketing system, to trigger email automatically, without using the browser. Today my system is using cron, and every time I enable it on a server, I need to configure the url of the scri...
asked by 21.10.2015 / 21:28
5
answers

How to use ajax and php to call a function in php?

I'm having trouble requesting a PHP function via Ajax AJAX Code: $.ajax({ url: 'geraSenhaProvisoria.php', type: 'POST', cache: false, data: {geraSenha(6, true, true, true)}, error: function() { alert('Erro ao t...
asked by 04.02.2015 / 12:24
8
answers

Check if variable contains a well-formatted e-mail address in PHP

The variable receives a value that is supposed to be an email address, but the doubts arise: Will it be an email address, a random text, or something else? Being an email address, is it well formatted? Assuming a valida_email() f...
asked by 05.03.2014 / 18:24
1
answer

What are the advantages of using a Generator (yield) in PHP?

Since PHP 5.5 was implemented in the Generator language. It can be used inside a function from the keyword yield . In the Manual , we have an example where one is compared to the function range(0, 1000000) (which theoretically...
asked by 10.02.2015 / 18:27
1
answer

When and where to use webservice?

I have an android app project that is similar to EasyTaxi (it does not have anything to do with taxi, but follow this logic of using map to locate "taxi drivers" in real time, with account registration and everything ...). Well, I know Android v...
asked by 16.04.2015 / 06:24
1
answer

Should we use all variables as private?

Should we always use the attributes of a class as private? What do private variables help prevent? How do you decide whether a particular property should be private or not? CASE, by default, each field is private, so why are there public da...
asked by 04.05.2017 / 03:44
2
answers

Risk in allowing developers to upload .blade files

I'm developing a blog platform where users submit their template and Laravel uses that template to build the blog. The user / developer will only tell you where the values will be, for example: <h2>{{$blog->title}}</h2> Can I...
asked by 11.11.2014 / 19:10
1
answer

Has anyone ever been able to use jQuery File Upload?

I refer to this link link. The documentation is very vague. I already changed the "action" of the "form" but without success. Html5 form: <form id="fileupload" action="bloco_img_upload.php" method="POST" enctype="multipart/form-data">...
asked by 22.04.2014 / 17:43
3
answers

Show age in years in php

I would like to get through the information date, the person's age in years: For example: 06/09/1991 - > 24 years 05/12/1998 - > 16 years old Suppose I have these dates in php $data1 = new DateTime('19910906'); $data2 = new DAte...
asked by 18.11.2015 / 03:06