Questions tagged as 'php'

2
answers

Format value with explode and PHP implode

I have a dhEmi tag that has this value 2016-09-09T08:10:52-03:00 To return a datetime I did the following. $dtemis = $item->infNFe->ide->dhEmi; $res = explode("T", $dtemis); $res1 = explode("-03:00", $res[1]); $array = arr...
asked by 09.09.2016 / 15:10
3
answers

Check if the value is integer

I use the following code in php to check if the number is integer: $qtd_bo = "1.20"; if (!preg_match('/^[1-9][0-9]*$/', $qtd_bo)) { echo "Não é inteiro"; } It returns me that number 1.20 is not integer. Until then, okay. The...
asked by 03.10.2016 / 15:37
3
answers

Remove only numeric elements from an array

I have an array like this: $arr = array('prolongar-se', 'durante, 4, 'a', 7, 'dias', 'dependendo', 'da', 'dose', 'administrada', 'e', 'do', 'pH', 'da', 'água', 'sendo', 7.5, 'ml', 'por','cada','paciente'); I would like to remove...
asked by 04.03.2017 / 20:55
1
answer

Why do they say that $ _GET in PHP is insecure against sql injection?

Well, my question is simple. I've been lately hearing many stories saying that $ _GET in PHP is insecure against sql injection. Could you tell me why? Thank you.     
asked by 06.03.2017 / 23:47
3
answers

AJAX with HTML data return

I have an AJAX function: function userCheck() { var username = $("#username").html(); var userid = $("#balmung-id").val(); $.ajax({ url: "systems/usercheck.php", type: 'POST', data: { username:...
asked by 22.12.2016 / 12:27
2
answers

How to solve the error Call to undefined function mysql_connect () [duplicate]

I'm doing an IT inventory to register and I want to connect to the database, but it's giving this error:    Fatal error: Uncaught Error: Call to undefined function   mysql_connect () in C: \ xampp \ htdocs \ xampp \ cadastrando.php: 9 Stack...
asked by 22.12.2016 / 15:20
2
answers

What are the Try / Catch blocks?

I would like to know what the try...catch blocks are. I would like more information in Portuguese, because in English I did not understand much, only that it would be a kind of if...else . What are these try...catch bl...
asked by 07.03.2017 / 19:20
1
answer

Adding data from a column

   id .. product ... value ... sales_id ... total value       01 .. Pen .... 2.00 .... 1 .......... 30.00       02 .. Rubber. 4.00 .... 2 ........... 25.50       03..Lapis ...... 5.00 .... 1 ........... 10.00       04 .. Pointer 9.00 ... 1 ....
asked by 05.01.2016 / 19:07
3
answers

How to subtract a date from the current system date

I want to subtract the current date from the system with the date that is written to mysql. I would like to insert the date in mysql through INSERT, manually, because I will not always use the current date to insert into the system. I need to...
asked by 19.11.2015 / 03:24
3
answers

How to separate HTML from PHP [closed]

I read in several places that one should not mix PHP with HTML and vice versa, How could I then separate this code for example: <?php include 'C:\xampp\htdocs\trabweb\sessaoBD.php' ?> <!--entra na sessão e na database --> <!DOC...
asked by 26.11.2018 / 16:06