Показать сообщение отдельно

  #4247  
Старый 22.07.2008, 08:54
5triker
Участник форума
Регистрация: 05.04.2007
Сообщений: 150
Провел на форуме:
771228

Репутация: 77
По умолчанию

PHP код:
<?
Error_Reporting
(E_ALL & ~E_NOTICE);
DEFINE ("SITE","www.evolutions.ru");
if (isset(
$_POST['form_sub']) and $_POST['form_sub']!="")
{
$link="/api/api_inf.php?Uname=".$_POST['user'];
    
$fp fsockopen(SITE80$errno$errstr30);
    if (!
$fp) {echo "$errstr ($errno)<br />\n";} 
    else 
    {
    
$file="";
    
$out "GET $link HTTP/1.1\r\n";
    
$out .= "Host: ".SITE."\r\n";
    
$out .= "Connection: Close\r\n\r\n";

    
fwrite($fp$out);
    while (!
feof($fp)) {
    
$file.=fgets($fp4096);
    }
    
fclose($fp);
    }
}
$file=strstr($file,"UserID");
$file=explode ("\n",$file);
foreach (
$file as $a)
{
$str_ex=explode ("::",$a);
$values[strtolower($str_ex[0])]=$str_ex[1];
}
?>
<form method=post>
USER<input type=text name=user><input type=submit name=form_sub value="check">
</form>
или

PHP код:
<?
Error_Reporting
(E_ALL & ~E_NOTICE);
if (isset(
$_POST['form_sub']) and $_POST['form_sub']!="")
{
$file=explode ("\n",file_get_contents("http://www.evolutions.ru/api/api_inf.php?Uname=".$_POST['user']));
foreach (
$file as $a)
{
$str_ex=explode ("::",$a);
$values[strtolower($str_ex[0])]=$str_ex[1];
}
}
?>

<form method=post>
USER<input type=text name=user><input type=submit name=form_sub value="check">
</form>
все значения в $values['нужное_поле_маленькими_бук вами'] например $values['userid'] , $values['username']
обработаеш дальше как нужно их

Последний раз редактировалось 5triker; 22.07.2008 в 09:06..
 
Ответить с цитированием