1
i have the function below in functions.php files
function get_ADRESS(){
if(isset($_POST['getcep']) and $_SERVER['REQUEST_METHOD'] == "POST"){
$cep = escape($_POST['cep']); //10
$cep = preg_replace("/[^0-9]/", "", $cep);
$url = "http://viacep.com.br/ws/$cep/xml/";
$xml = @simplexml_load_file($url);
echo $xml;
}
}
}
$XML
is a matrix that returns me zip, street, Uf, number. What I need to do is run the get_addressee function on the Register.php page and then enter these values in the HTML below, how can I do this ?
<div class="form-group">
<div class="col-lg-10">
<input type="text" class="form-control" placeholder="Endereço" id="cep_load" name="cep_load" value="{$cep}">
</div>
</div>
<div class="form-group">
<div class="col-lg-10">
<input type="text" class="form-control" placeholder="Endereço" id="address" name="address" value="{$rua}">
</div>
</div>
<div class="form-group">
<div class="col-lg-10">
<input class="form-control" id="city" name="city" placeholder="Cidade" value="{$cidade}" >
</div>
</div>
Bartomeu, Thank you very much msm! Abs
– Felipe Lima Diniz