Jump to content
  • 0

Castle php


Question

9 answers to this question

Recommended Posts

  • 0
Posted

Note: Not tested.

 

<?

  $host = "91.205.74.22";

  $user = "root";

  $password = "66778811";

  $dbase = "l2jdb";

 

  $connect = mysql_connect ($host,$root,$password) or die ("Could not connect to Server");

  $db_connect = mysql_select_db ($dbase,$connect) or die ("Could not connect to Data Base");

?>

 

 

<body>

<table width="332" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td width="322"><div align="center">

      <p>ADEN</p>

      <p><img src="graficos/castillo_aden.jpg" width="322" height="233" /></p>

      <p>

    <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 5";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";

    ?>

    </p>

    </div></td>

  </tr>

  <tr>

    <td><div align="center">

      <p>DION</p>

      <p><img src="graficos/castillo_dion.jpg" width="322" height="233" /></p>

      <p>

    <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 2";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";

    ?>

    </p>

    </div></td>

  </tr>

  <tr>

    <td><div align="center">

      <p>GIRAN</p>

      <p><img src="graficos/castillo_giran.jpg" width="322" height="233" /></p>

      <p>

        <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 3";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";

    ?>

      </p>

    </div></td>

  </tr>

  <tr>

    <td><div align="center">

      <p>GLUDIO</p>

      <p><img src="graficos/castillo_gludio.jpg" width="322" height="233" /></p>

      <p>

        <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 1";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";    ?>

      </p>

    </div></td>

  </tr>

  <tr>

    <td><div align="center">

      <p>GODDARD</p>

      <p><img src="graficos/castillo_goddard.jpg" width="322" height="233" /></p>

      <p>

        <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 7";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";

    ?>

      </p>

    </div></td>

  </tr>

  <tr>

    <td><div align="center">

      <p>INNADRIL</p>

      <p><img src="graficos/castillo_innadril.jpg" width="322" height="233" /></p>

      <p>

        <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 6";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";

    ?>

      </p>

    </div></td>

  </tr>

  <tr>

    <td><div align="center">

      <p>OREN</p>

      <p><img src="graficos/castillo_oren.jpg" width="322" height="233" /></p>

      <p>

        <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 4";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";

    ?>

      </p>

    </div></td>

  </tr>

  <tr>

    <td><div align="center">

      <p>RUNE</p>

      <p><img src="graficos/castillo_rune.jpg" width="322" height="233" /></p>

      <p>

        <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 8";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";

    ?>

      </p>

    </div></td>

  </tr>

  <tr>

    <td><div align="center">

      <p>STUTGART</p>

      <p><img src="graficos/castillo_stutgart.jpg" width="322" height="233" /></p>

      <p>

        <?

        require ("config.php");

        $query = "Select clan_name from clan_data where hasCastle = 9";

      $mk = mysql_query($query);

      $res = mysql_fetch_array($mk);

      if ($res['clan_name']=="") { $res = "nadie."; } else {$res = $res['clan_name']; }

      echo "<center>En posesion de ".$res."</center>";

    ?>

      </p>

    </div></td>

  </tr>

</table>

</body>

  • 0
Posted

dude that http://www.maxcheaters.com/forum/index.php?topic=33862.0 is the script i have but i gave castle to my char and change siege time but nothing changed... and what it means add attribute 777 to helios?

  • 0
Posted

dude that http://www.maxcheaters.com/forum/index.php?topic=33862.0 is the script i have but i gave castle to my char and change siege time but nothing changed... and what it means add attribute 777 to helios?

 

Im not sure, but i guess he was talking about files permission (acces/hmods)

 

Open your ftp client, and press right mouse button on this file and set permission to 777.

  • 0
Posted

Anyway Matim you should have used a loop for the queries, makes no sense making a script that big when you can replace it with a loop. e.g.

require_once('config.php');
while($i=<castlenumber)
{
$i++;
echo '<td><div align="center">
     <p>GLUDIO</p>
     <p><img src="graficos/'getCastleImg($i)'" width="322" height="233" /></p>
     <p>'
       $query = "Select clan_name from clan_data where hasCastle = '$i'";
     $mk = mysql_query($query);
     $res = mysql_fetch_array($mk);
     if ($res['clan_name']=="") { $res = 'nadie.'; } else {$res = $res['clan_name']; }
     '<center>En posesion de '.$res.'</center>';     ?>
}

Obviously you'd have to make a function that returns the image name based on the $i ,and, the script probably has tons of errors since I just made it here in the board in 20 seconds without notepad or smth but you get the picture ^^

  • 0
Posted

Anyway Matim you should have used a loop for the queries, makes no sense making a script that big when you can replace it with a loop. e.g.

require_once('config.php');
while($i=<castlenumber)
{
$i++;
echo '<td><div align="center">
      <p>GLUDIO</p>
      <p><img src="graficos/'getCastleImg($i)'" width="322" height="233" /></p>
      <p>'
        $query = "Select clan_name from clan_data where hasCastle = '$i'";
      $mk = mysql_query($query);
      $res = mysql_fetch_array($mk);
      if ($res['clan_name']=="") { $res = 'nadie.'; } else {$res = $res['clan_name']; }
      '<center>En posesion de '.$res.'</center>';     ?>
}

Obviously you'd have to make a function that returns the image name based on the $i ,and, the script probably has tons of errors since I just made it here in the board in 20 seconds without notepad or smth but you get the picture ^^

dude i cant understand what you posted, i am newbie at php so more info would be explain smt more...

  • 0
Posted

Oh my post was to Matim x)

 

Sorry about that. But you can use what I gave you as a start, read some PHP tutorials and you'll get it ^^

 

Im not author of this PHP Script (thats why i told him its not tested, i just saw it somewhere)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...