PHP - recibir dato de script php

 
Vista:
sin imagen de perfil
Val: 25
Ha aumentado su posición en 4 puestos en PHP (en relación al último mes)
Gráfica de PHP

recibir dato de script php

Publicado por Ruben (25 intervenciones) el 05/05/2019 18:19:24
Buenas

quiero poder recibir una respuesta (boolean) desde unscript php a mi aplicacion cb6...


El codigo PHP funciona correctamnete
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
<?php
 
 
$Nombre = $_GET['Nombre'];
 
 
//Se Abre archivo Texto Lista Usuarios
$Lista = fopen('ListUsuarios.txt','r');
 
//Comprobamos si Nombre ya figura en la Lista
$Esta = false;
while ($linea = fgets($Lista))
{
    if ($linea===$Nombre )
    {
        $Esta = true;
        //break;
    }
}
 
fclose($Lista);
 
 //Si no esta en la lista lo incorporamos
if(!$Esta)
{
    $Lista = fopen('ListUsuarios.txt','a');
    fwrite($Lista,$Nombre. PHP_EOL);
    fclose($fp);
}
 
echo $Esta;
 
?>

En principio quiero que me devuelva como respuesta el booleano $Esta.

Uilizo un api wininet para llamar al scrip y en teoria recibir la respuesta.

seria:.

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
AnsiString NomUsers ="xxxx";
 
  BYTE  Buffer;
  DWORD BytesRead;
 
  const ::HINTERNET sesion = InternetOpen("agent",INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL,0);
  if(sesion!=NULL)
  {
 
     AnsiString Url = "http://xxxxxx.es//GPrUsers//Registrado.php?Nombre="+NomUsers;
     const ::HINTERNET handle = ::InternetOpenUrl(sesion,Url.c_str(),NULL,0, INTERNET_FLAG_RELOAD, 0);
     if(handle!=NULL)
     {
        InternetReadFile(handle,&Buffer,sizeof(Byte),&BytesRead);
        //Si Existe
        if(Buffer!=0)
        {
          //EXISTE
        }
        else
        {
          //NO EXISTE
        }
     }
    InternetCloseHandle(handle);
  }
  else
  {
 
  }
   InternetCloseHandle(sesion);

no doy recogido el valor booleano en Buffer... que hago mal.. grarcias
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