Enviar Texto desde el servidor a web.
#7

Una forma usando php seria guardando el dato que envias en un archivo de texto.

esto lo guardas con el nombre test.php
PHP код:
<form method="GET">
    <input type ="hidden" name="value">
</form>
<?php
$string 
= @$_GET['value'];
if(
strlen($string)) {
    
$file fopen("texto.txt","w");
    
fwrite($file,$string);
    
fclose($file);
}
else {
    
$file fopen("texto.txt","r");
    echo 
fread($file,1024);
    
fclose($file);
}
y esto como un fs, al escribir en la consola se envia el dato, para verlo tendrias que entrar a la direcciуn "127.0.0.1/test.php" (suponiendo que tenйs php instalado en tu pc)
pawn Код:
#include <a_samp>
#include <a_http>

public OnRconCommand(cmd[]) {
    new string[1024];
    format(string,sizeof(string),"localhost/test.php?value=%s",cmd);
    for(new i=0; i < strlen(string); i++) {
        if(string[i] == ' ') {
            string[i] = '%';
            strins(string,"20",i+1);
            i += 2;
        }
    }
    HTTP(0,HTTP_GET,string,"","CallBack");
    print(string);
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)