Questions tagged as 'php'

2
answers

Time calculation based on GMT and daylight saving time

I have a problem where I need to calculate the time in a particular place in the world. The calculation should happen and the only information I have in hand is GMT of the site. EX: -1, 2, -3, etc. I've created a class to calculate GMT-based...
asked by 10.12.2014 / 19:19
2
answers

How to calculate hash?

How do I calculate the hash of a torrent file with PHP? I already used the class BEncoded and it worked, but wanted to know how it works.     
asked by 16.12.2014 / 21:15
1
answer

How do I get the name of the current function?

Good evening. I would like to know if there is any way to get the name of the function being used, type this: public function nome_funcao(){ $nome_funcao = $this -> "nome_funcao"; } I do not know if it was clear, but I want to ret...
asked by 09.04.2017 / 03:39
1
answer

How to convert Python encryption to PHP?

I would like to know if it is possible to convert this encryption to the PHP language, I need to convert the passwords that were generated to be accepted in my Login system on the site, but I do not know how to do it. I have a database with p...
asked by 10.08.2017 / 14:19
2
answers

Sending / Uploading images with php [closed]

Form <label>Imagem do produto:</label> <input type="file" name="imagem-produto"> Script $foto = $_POST["imagem-produto"]; $tamanhoMax = 1024 * 1024; # 1MB if (isset($_FILES['imagem-produto']['name']) && $_FILES[...
asked by 13.12.2016 / 10:24
1
answer

How many $ _POST records of a form with dynamic input? [duplicate]

I have a form with dynamic fields but I noticed that when I send it it limits to 166 records. In my form the fields are within a WHILE like this: <input name="contagem[]" type="hidden" value="<?php echo $contagem; ?>" /> <i...
asked by 23.11.2016 / 04:49
2
answers

Limit database results?

Continuing with the lesson videos, I came across a method of displaying data from the database a bit differently, in the video it is used: $result = mysqli_query($conn, 'SELECT * FROM comentarios ORDER BY data DESC'); $row = mysqli_fetch_assoc...
asked by 17.12.2015 / 17:15
3
answers

No select error using mysqli_query

I've done a php to list the rooms, but I'm having difficulty listing them, if anyone can help me, I would appreciate it. <?php $link = mysqli_connect("localhost","root","","hotel"); $result = mysqli_query("SELECT descricao FROM quartos WHER...
asked by 08.06.2015 / 21:53
3
answers

Convert data in the format dd / mm / yyyy to yyyy-mm-dd

I'm getting two post in php from two dates in the format dd / mm / yyyy however to display the precise data convert from dd / mm / yyyy to yyyy-mm-dd Code: if(isset($_POST)) // Se existir o array post, pq ele não retorna undefined inde...
asked by 16.04.2015 / 20:46
2
answers

Linebreak encoding (\ n) in Javascript alert ()

Hello, I need to make a replace in the string </script> by transforming it to the string \n . The problem is that unfortunately my PHP project is with charset=ISO-8859-1 , while javascript runs with UTF8 . Wh...
asked by 17.09.2014 / 19:42