PHP - Incorporar formulario a mi página

 
Vista:

Incorporar formulario a mi página

Publicado por Michel (1 intervención) el 19/06/2019 08:08:53
Hola chicos, tengo una consulta, quiero incorporar un formulario a mi web (https://lacurp.com.mx/consultar/) que conecte directamente con el servicio gubernamental de mexico para realizar las consulas directamente a su plataforma.

El sitio en cuestión es este: https://www.gob.mx/curp/. ¿Se os ocurre alguna manera para implementar este formulario en mi web?

Lo unico que se me ocurre es un embed... ¡Gracias de antemano!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Mauro
Val: 2.761
Oro
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

Incorporar formulario a mi página

Publicado por Mauro (1037 intervenciones) el 19/06/2019 19:54:29
¿Qué problema tendría el embed?

De última, podrías copiar el html y pegarlo en tu página... o armar tu propio formulario, con tal que respete el action y los nombres de los inputs deberías andar bien...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Incorporar formulario a mi página

Publicado por Rodrigo (3 intervenciones) el 08/07/2019 02:44:46
Que tal, espero te sirva:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
 
$peticion = '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ValidateMexico">

   <soapenv:Header/>
   <soapenv:Body>
      <urn:Curp soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
     <return xsi:type="urn:CurpReq">
        <user xsi:type="xsd:string">prueba</user>
        <password xsi:type="xsd:string">sC}9pW1Q]c</password>
        <Curp xsi:type="xsd:string">LOOA531113HTCPBN07</Curp>
     </return>
      </urn:Curp>
   </soapenv:Body>
</soapenv:Envelope>';
 
    $header = array(
 
        'Content-type: text/xml;charset="utf-8"',
 
        'Accept-Encoding: gzip, deflate',
 
        'SOAPAction: "urn:ValidateMexico#Curp"',
 
        'Connection: Keep-Alive',
 
        'Content-length: '.strlen($peticion),
 
    );
 
    $curl = curl_init();
 
    curl_setopt($curl, CURLOPT_URL, 'http://187.160.251.219/ws/index.php');
 
    curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36');
 
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
 
    curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1);
 
    curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
 
    curl_setopt($curl, CURLOPT_POSTFIELDS, $peticion);
 
    curl_setopt($curl, CURLOPT_ENCODING, $peticion);
 
    $re = curl_exec($curl);
 
curl_close($curl);
 
$doom = new \DOMDocument();
 
$doom->loadXML($re);
 
$estatus = $doom->getElementsByTagName('Response')->item(0)->nodeValue;
 
if ($estatus=='correct') {
 
        echo 'Curp: '.  $doom->getElementsByTagName('Curp')->item(0)->nodeValue ."<br/>";
 
        echo 'Paterno: '.$doom->getElementsByTagName('Paterno')->item(0)->nodeValue."<br/>";
 
        echo 'Materno: '.$doom->getElementsByTagName('Materno')->item(0)->nodeValue."<br/>";
 
        echo 'Nombre: '.$doom->getElementsByTagName('Nombre')->item(0)->nodeValue."<br/>";
 
}else{
 
    echo "Error";
 
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar