View Single Post
Old 01.01.2007, 01:30   #94
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default

hmm I dont know php too much, so I changed it alittle bit..
simply I changed it to normal form where u insert name of player and it will forward to another my php code where it will change to ID ;] (I dont know code too much so I dont know how to merge it :-DD )

Code:
case 200:
                         $get_char_id=htmlspecialchars($_POST["param1"]);
			 if(strlen($get_char_id)<1){ ?>
				<form method='get' action='charid.php?char='><b>Get char id by char name: </b>
                                <br><input name='char' size='10' value=''>
				<br><input type='submit' value='odeslat'></form><?php }
			break;

charid.php

Code:
<?php

include("config.php");

echo "<html><head></head>
<style type=text/css>
A:link {
COLOR: #dd6900;
}
A:visited {
	COLOR: #dd6900;
}
A:hover {
	COLOR: #dd6900;
}
A:active {
	COLOR: #dd6900;
}
    body, html { font-size: 5px; background-color: black; margin: 0px; margin-top: 5px; margin-bottom: 5px; color: #dd6900; }
    td { margin: 0px; padding: 0px; font-size: 14px; font-family: Tahoma, Verdana, Arial; color: #dd6900; }
    .tbl_mainpage { width: 700px; margin: auto; border: 0px #5b5b5b solid; background-color: black; color: #dd6900; }
    .tbl_title { height: 40px; font-size: 20px; text-align: center; vertical-align: middle; }
    .tbl_time { text-align: center; height: 20px; border-bottom: 1px #dd6900 solid; color: ##dd6900; }
    .tbl_head { border-bottom: 1px black solid; }
    .tbl_female { background-color: #660000; clear: both;}
    .tbl_male { background-color: #000000; clear: both; }
    .tbl_charord { width: 30px; text-align: center; border-right: 1px #dd6900 solid; }
    .tbl_charname { width: 300px; text-align: center; border-right: 1px #dd6900 solid; border-left: 1px #dd6900 solid;}
    .tbl_charclass { width: 100px; text-align: center; border-right: 1px #dd6900 solid; }
    .tbl_charlevel { width: 30px; text-align: center; border-right: 1px #dd6900 solid; }
  </style>
  <table class=tbl_mainpage cellspacing=0 cellpadding=0 align=center>
   <tr>
    <td class=tbl_charclass tbl_head><b>Char Name</b></td>
    <td class=tbl_charclass tbl_head><b>Char ID</b></td>
    </tr>";
  mssql_select_db("lin2world");
  $mssql["result"] = mssql_query("declare @char int; set @char = (select char_id from lin2world..user_data where char_name = '$_GET[char]'); select char_id, char_name from user_data where char_id = @char");
  $i = 0;
  while($mssql["entry"] = mssql_fetch_array($mssql["result"])) {
    $i++;

   echo "
      <td class=tbl_charclass>".$mssql[entry][char_name]."</center></td>
      <td class=tbl_charclass>".$mssql[entry][char_id]."</center></td>
    </tr></table></body></html>"; }
?>


config.php

Code:
<?php

  header("Expires: ". gmdate("D, d M Y H:i:s")." GMT");

  $mssql["server"] = "hyperjadro";   
  $mssql["user"] = "";
  $mssql["password"] = "";
  $mssql["database"] = "lin2db";
  $mssql["die"] = "Error in connection to MS SQL";
  mssql_connect($mssql["server"], $mssql["user"], $mssql["password"]); // or die($mssql["die"])
  mssql_select_db($mssql["database"]);
?>
rodier is offline