Síða 1 af 1

Server registration

Sent: Sun 07. Des 2008 21:42
af Ordos
Ég er hérna að gera private server í leik fyrir vin minn og register síðan verður alltaf eithvað skrítin :
Afsakið Stærðina á myndini
Mynd
hérna er kóðinn:

Kóði: Velja allt

<?
include('config.php');
$page = " ";
if(auth() == -1)
   {
      $page = "<form action=\"login.php\" method=\"POST\">
               <br><br><br><table class=\"tabset_content\">
                  <tr><td colspan=2><span class=\"t_n_t\">Login</span></td></tr>
                  <tr><td>Username:</td><td><input class=\"text\" type=\"text\" width=20 name=\"login\" /></td></tr>
                  <tr><td>Password:</td><td><input class=\"text\" type=\"password\" width=20 name=\"password\" /></td></tr>
                  <tr><td><a href=\"reg.php\">Register</a></td><td align=\"right\"><input type=\"submit\" class=\"button\" value=\" Login \" /></td></tr>
               </table>
            </form>";
   }

else if(auth() == 99)
   {
      
      $page = "<br><br><br><table class=\"tabset_content\"  width=125>
               <tr align=\"left\"><td><span class=\"t_n_t\">Menu</span></td></tr>
               <tr align=\"left\"><td>~<a href=\"list.php?type=char\">Characters</a></td></tr>
               <tr align=\"left\"><td>~<a href=\"list.php?type=act\">Accounts</a></td></tr>
               <tr align=\"left\"><td>~<a href=\"guild.php\">Guilds</a></td></tr>
               <tr align=\"left\"><td>~<a href=\"search.php\">Search</a></td></tr>
               <tr align=\"left\"><td>~<a href=\"info.php\">Help</a></td></tr>
               <tr align=\"left\"><td>~<a href=\"logout.php\">Logout</a></td></tr>
            </table>";
      
      $page .= "<form action=\"search.php\" method=\"GET\">
            <br /><table class=\"tabset_content\" width=125>
               <tr align=\"left\"><td><span class=\"t_n_t\"> Quick Search</span></td></tr>
               <tr align=\"left\"><td><input class=\"text\" type=\"text\" width=20 name=\"q\" /></td></tr>
               <tr align=\"left\"><td><input type=\"radio\" name=\"type\" value=\"act\" checked /> Account</td></tr>
               <tr align=\"left\"><td><input type=\"radio\" name=\"type\" value=\"cha\" /> Character</td></tr>
               <tr align=\"right\"><td><input type=\"submit\" class=\"button\" value=\" Search \" /></td></tr>
            </table></form>";
   }
else if(auth() == 0)
   {
      
      $page = "<br><br><br><table class=\"tabset_content\"  width=125>
               <tr align=\"left\"><td><span class=\"t_n_t\">Menu</span></td></tr>
               <tr align=\"left\"><td>~<a href=\"guild.php\">Guilds</a></td></tr>
               <tr align=\"left\"><td>~<a href=\"list.php?type=all\">Character List</a></td></tr>
               <tr align=\"left\"><td>~<a href=\"logout.php\">Logout</a></td></tr>
            </table>";
   }
   
$page .= "<br><br><div style=\"width:700px;\"><div style=\"float:left;\">
      <span class=\"t_n_t\">Top 10 Highest Level Players</span>
      <table width=300 class=\"tabset_content\">
            <tr><td>#</td><td>Name</td><td>Job</td><td>Experience</td></tr>";
if($count_gm_in_top == true)
   $result = do_query("SELECT TOP 10 * FROM character WHERE act_id IN(SELECT act_id FROM account) ORDER BY exp DESC","GameDB");
else
   $result = do_query("SELECT TOP 10 * FROM character WHERE act_id IN(SELECT act_id FROM account WHERE gm = 0) ORDER BY exp DESC","GameDB");
$i=0;
while($result2 = mssql_fetch_object($result))
   {   
      $i++;
      $job = zh_to_eng($result2->job,$chinese_jobs);
      $page .= "\n<tr class=\"t_b_f\"><td>$i.</td><td>$result2->cha_name</td><td>$job</td><td>".number_format($result2->exp)." (Lv:" . exp_to_lv($result2->exp) . ")</td></tr>";
   }
$page .= "</table></div>";

$page .= "\n\n<div style=\"float:right;\">
         <span class=\"t_n_t\">Top 10 Richest Players</span>
         <table width=300 class=\"tabset_content\">
               <tr><td>#</td><td>Name</td><td>Job</td><td>Gold</td></tr>";
if($count_gm_in_top == true)
   $result = do_query("SELECT TOP 10 * FROM character WHERE act_id IN(SELECT act_id FROM account) AND delflag = 0 ORDER BY gd DESC","GameDB");
else
   $result = do_query("SELECT TOP 10 * FROM character WHERE act_id IN(SELECT act_id FROM account WHERE gm = 0) AND delflag = 0 ORDER BY gd DESC","GameDB");
$i=0;
while($result2 = mssql_fetch_object($result))
   {   
      $i++;
      $job = zh_to_eng($result2->job,$chinese_jobs);
      $page .= "\n<tr class=\"t_b_f\"><td>$i.</td><td>$result2->cha_name</td><td>$job</td><td>".number_format($result2->gd)."</td></tr>";
   }
$page .= "</table></div><br><br><br></div>";

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<Title>Tales of Pirates Cotrol Panel</title>
<link rel="stylesheet" href="styles.css" type="text/css">

</head>

<body >
<center>
<div id="top_bar"><div style="float:left;">Welcome <?
if(auth() == -1){
echo "<strong>Guest</strong>!";}
else{
echo "<Strong>".$_COOKIE['PKO_login']."</strong>!";}
?></div><a href="index.php">Home</a> :: <a href="search.php">Search</a> :: <a href="logout.php">Log Out</a></div>
<?

echo $page;

$result = do_query("SELECT * FROM account_login","AccountServer");
$num_act = mssql_num_rows($result);

$result = do_query("SELECT cha_id FROM character","GameDB");
$num_char = mssql_num_rows($result);

echo "<div style=\"clear:both;margin-top:50px;\"><table>
      <tr><td>Total Accounts:</td><td>". $num_act. "</td></tr>
      <tr><td>Total Character:</td><td>".$num_char."</td></tr>
   </table></div>";

?>
<br><br><div style="position:fixed;bottom:0px;left:0px;font-size:10pt;">Tales of Pirates Control Panel was created by Sjikke</div>
</center>
</body>

</html>

Hvað skal gera ?

Re: Server registration

Sent: Sun 07. Des 2008 21:48
af Revenant
Setja upp php og mysql á vefþjóninn.

Re: Server registration

Sent: Sun 07. Des 2008 22:02
af Ordos
er að nota xampp

Re: Server registration

Sent: Þri 09. Des 2008 18:03
af tms
Skiptu

Kóði: Velja allt

include('config.php');
<?

í

Kóði: Velja allt

<?php
include('config.php');

Re: Server registration

Sent: Þri 09. Des 2008 19:10
af Ordos
tms skrifaði:Skiptu

Kóði: Velja allt

include('config.php');
<?

í

Kóði: Velja allt

<?php
include('config.php');

hmm breytti engu :(

Re: Server registration

Sent: Mið 10. Des 2008 10:27
af Dagur
Það er greinilega eitthvað að PHP uppsetningunni, serverinn lítur á .php sem hvert annað textaskjal.