-1
I’m testing the https://github.com/jansenfelipe/cnpj-gratis.
He returns to me after the query the following information:
array(21) { ["data_abertura"]=> string(10) "23/05/1979" ["razao_social"]=>
string(10) "SADIA S.A." ["nome_fantasia"]=> string(8) "********"
["cnae_principal"]=> string(8) "********" ["cnaes_secundario"]=> string(8)
"********" ["natureza_juridica"]=> string(34) "205-4 - Sociedade Anônima
Fechada" ["logradouro"]=> string(8) "********" ["numero"]=> string(8)
"********" ["complemento"]=> string(8) "********" ["cep"]=> string(8)
"********" ["bairro"]=> string(8) "********" ["cidade"]=> string(8)
"********" ["uf"]=> string(2) "**" ["email"]=> string(27) "Delmir.Dal-
[email protected]" ["telefone"]=> string(13) "(49) 4443-000"
["ente_federativo_responsavel"]=> string(5) "*****" ["situacao_cadastral"]=>
string(7) "BAIXADA" ["situacao_cadastral_data"]=> string(10) "31/12/2012"
["motivo_situacao_cadastral"]=> string(12) "INCORPORACAO"
["situacao_especial"]=> string(8) "********" ["situacao_especial_data"]=>
string(8) "********" }
This is the php code:
<?php
require_once '../vendor/autoload.php';
use JansenFelipe\CnpjGratis\CnpjGratis;
if(isset($_POST['captcha']) && isset($_POST['cookie']) &&
isset($_POST['cnpj'])){
$dados = CnpjGratis::consulta($_POST['cnpj'], $_POST['captcha'],
$_POST['cookie']);
var_dump($dados);
die;
}else
$params = CnpjGratis::getParams();
?>
<img src="data:image/png;base64,<?php echo $params['captchaBase64'] ?>" />
<form method="POST">
<input type="hidden" name="cookie" value="<?php echo $params['cookie'] ?>"
/>
<input type="text" name="captcha" placeholder="Captcha" />
<input type="text" name="cnpj" placeholder="CNPJ" />
<button type="submit">Consultar</button>
</form>
How can I get the information and self-prefill an input with it?
You want to fill only 1 input with all the information or for each information a new input?
– Andrei Coelho