Questions tagged as 'php'

2
answers

Always present an error when I try to use the mysqli expression

I know that the expression mysql has been deprecated, so I'm trying to use the expression mysqli , but every time I try it shows me a syntax error! example: $buscaDados = mysqli_query("SELECT * FROM usuario"); Generate this er...
asked by 04.03.2014 / 23:13
2
answers

Is it possible to instantiate a class without storing it in a variable?

I usually do this: $a = new MinhaClass($Parametro); Can you do this without creating the $a variable? Only with new ?     
asked by 31.12.2017 / 15:39
3
answers

createElement () method in PHP

In javascript, I can do: var span = document.createElement('span'); span.innerHTML = 'foo'; span.className = 'bar'; Is there something similar so that I can create a ElementNode in PHP, at least with the basic attributes (name, class...
asked by 23.01.2014 / 00:23
7
answers

How to send email automatically?

How to automatically send emails using PHP? I have a form that receives several dates and when there is 10 days to finish the deadline, a message is sent to several people with the warning. I've been told to use the Cron job . But this is...
asked by 30.01.2014 / 16:48
2
answers

Query MySQL in PHP only works locally

It's as follows: the system I'm servicing was using two query types (do not ask me why) and locally (localhost) work perfectly. When I uploaded the project to the server, the queries declared like this: <?php $sql = mysql_query("INSERT INTO...
asked by 11.02.2014 / 18:21
2
answers

How to get 2 PHP arrays and join in 1 string

I have 2 arrays in PHP that come from a form $_POST['qtd'] and $_POST['ing'] : array(2) { [0]=> string(1) "1" [1]=> string(1) "2" } array(2) { [0]=> string(1) "a" [1]=> string(1) "b" } How can you put them togethe...
asked by 10.09.2018 / 21:42
3
answers

Filter word in a text with php

I would like to extract some words in a text with php. But they are not fixed words .. I want words that will always change but they will be next to standard keywords EX: ID: 123123 Name: Elvis Address: Totis bla I want to filter the value...
asked by 04.07.2014 / 13:46
2
answers

Complete number with leading zeros with PHP

I have a field with a limit of 4 characters where I will enter a value, I would like the remaining space to be completed with zeros from left to right, for example, if the user enters the number 4. I would have to leave 0004 if I inserted 100 ,...
asked by 26.10.2017 / 18:14
2
answers

Error using phpMailer class

I am making a contact form using the phpMailer class and every time I send the email this error occurs: I'm using the SMTP connection. "Fatal error: Class 'SMTP' not found in /home/proftpd/[email protected]/PHPMailer/class.phpmailer.php o...
asked by 11.06.2016 / 16:04
2
answers

What are modules in programming?

I know there is this question: What are modules ? But the explanation did not go straight to the point and it left me confused, as well as properties, methods, arguments and other words I've already seen quite the use of the word modules ....
asked by 18.05.2016 / 19:52