[PHP] Joomla question.

Joined
Dec 2, 2006
Messages
1,617
Reaction score
152
hi everyone, i have a kalonline server and i am trying to build a new website for my server using Joomla, im trying to add my custom php scripts but it dosent really like it. if you guys could help i would really appreciate it.

see to add a new page i go add article and then to put custom code i click the custom html button,
Zen - [PHP] Joomla question. - RaGEZONE Forums



this is my regestration script that i added. i want to have the standard Joomla regestration, then have this one as a custom page. (this is to log in ingame, joomla one is for the site/forums.)
PHP:
<?php
  function pw_umwandeln($pw)
  {
    $hex = array(
    '95', '88', '9D', '4C', 'F2', '3E', 'BB', 'C0', '7F', '18', '70', 'A6', 'E2', 'EC', '77', '8A',
    '2C', '3A', '4A', '91', '5D', '7A', '29', 'BC', '6E', 'D4', '40', '17', '2E', 'CB', '72', '9C',
    'A1', 'FF', 'F3', 'F8', '9B', '50', '51', '6D', 'E9', '9A', 'B8', '84', 'A8', '14', '38', 'CE',
    '92', '5C', 'F5', 'EE', 'B3', '89', '7B', 'A2', 'AD', '71', 'E3', 'D5', 'BF', '53', '28', '44',
    '33', '48', 'DB', 'FC', '09', '1F', '94', '12', '73', '37', '82', '81', '39', 'C2', '8D', '7D',
    '08', '4F', 'B0', 'FE', '79', '0B', 'D6', '23', '7C', '4B', '8E', '06', '5A', 'CC', '62', '2D'
    );

    $alpha = array(
    '!', '"', '#', '$', '%', '&', '\'', '.', '(', ')', '*', '+', ',', '-', '.', '/',
    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
    '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
    '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
    'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', ''
    );

    $pw_neu = '0x';
    $i=0;

    for($j=0; $j < strlen($pw); $j++)
    {
      $zeichen = $pw[$j];
      for($i=0; $i < count($alpha); $i++)
      {
        if($zeichen == $alpha[$i])
        {
          $pw_neu .= $hex[$i];
        }
      }

      if($i == count($alpha) - 1)
        die('Es ist ein Fehler aufgetreten. Zeile: '.__LINE__);
    }

    return $pw_neu;
  }

  function meldung($meldung_de, $meldung_en)
  {
    global $sprache, $meldung;
    if($sprache == 'en')
      $meldung[] = $meldung_en;
    else
      $meldung[] = $meldung_de;
  }

  $text_de = array(
    'Account ID',
    'Password',
    'Retype Password',
    'Birthdate: [DD.MM.YYYY]',
    'Charactername',
    'Characterclass',
    'Register'
  );

  $text_en = array(
    'Account ID',
    'Password',
    'Retype Password',
    'Birthdate: [DD.MM.YYYY]',
    'Charactername',
    'Characterclass',
    'Register'
  );

  $meldung = array();
  $fertig = false;

  if($_GET['sprache'] == 'en')
  {
    $sprache = 'en';
    $text = $text_en;
  }
  else
  {
    $sprache = 'de';
    $text = $text_de;
  }

  mssql_connect('localhost') or die('mist');
  mssql_select_db('kal_auth') or die('kack');

  if(isset($_POST['anmelden']))
  {
    $_POST['loginname'] = addslashes(trim($_POST['loginname']));
    $_POST['passwort'] = addslashes(trim($_POST['passwort']));
    #$_POST['spielername'] = addslashes(trim($_POST['spielername']));

    if(empty($_POST['loginname']))
      meldung('Enter ID', 'Enter ID');
    else if(strlen($_POST['loginname']) < 3 || strlen($_POST['loginname']) > 12)
      meldung('Your ID Must Have 3-12 Characters', 'Your ID Must Have 3-12 Characters');
    else
    {
      $rs = mssql_query("SELECT 1 FROM Login WHERE ID = '".$_POST['loginname']."'");
      if(mssql_num_rows($rs) != 0)
        meldung('The ID Is Already In Use', 'The ID Is Already In Use');
    }

    if(empty($_POST['passwort1']) || empty($_POST['passwort2']))
      meldung('Enter Password', 'Enter Password');
    else if($_POST['passwort1'] != $_POST['passwort2'])
      meldung('Pass***** Are Different', 'Pass***** Are Different');
    else if(strlen($_POST['passwort1']) < 3 || strlen($_POST['passwort2']) > 30)
      meldung('Your Password Must Have 3-30 Characters', 'Your Password Must Have 3-30 Characters');
             
    if(empty($_POST['geburtstag']))
      meldung('Enter Your Birthdate', 'Enter Your Birthdate');
    else if(!preg_match('-\d{1,2}\.\d{1,2}\.\d{4}-', $_POST['geburtstag']))
      meldung('Wrong Birthdate', 'Wrong Birthdate');
    else
    {
      $wert = explode('.', $_POST['geburtstag']);
      $wert[0] *= 1; $wert[1] *= 1; $wert[2] *= 1;

      if(!checkdate($wert[1], $wert[0], $wert[2]) || $wert[2] < 1900 || $wert[2] > 2500)
        meldung('Wrong Birthdate', 'Wrong Birthdate');
    }      

    if(count($meldung) == 0)
    {
      mssql_select_db('kal_auth');

      $rs = mssql_query("exec(\"INSERT INTO Login (ID, PWD, Birth, Type, ExpTime) VALUES('".$_POST['loginname']."', ".pw_umwandeln($_POST['passwort1']).", '".$_POST['spielername']."', 0, 4000) SELECT @@IDENTITY as lastid\")");
      list($lastid) = mssql_fetch_row($rs);

      meldung('Registration Succesfull', 'Registration Succesfull');
      $fertig = true;
    }
  }
?>
<html>
<head>
<title>KAL-Online Private Server ::: Account Registration</title>
<meta name="author" content="XAX">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
</p>
<?php
  if(count($meldung) != 0)
    echo '<h3>'.implode($meldung, '<br>').'</h3>';

  if(!$fertig)
  {
?>
<form action="index.php?site=register" method="post">
<table>
<tr>
 <td><?php echo $text[0]; ?>:</td>
 <td><input type="Text" name="loginname" value="<?php echo $_POST['loginname']; ?>" size="12" maxlength="12"></td>
</tr>
<tr>
 <td><?php echo $text[1]; ?>:</td>
 <td><input type="Password" name="passwort1" value="<?php echo $_POST['passwort1']; ?>" size="20" maxlength="30"></td>
</tr>
<tr>
 <td><?php echo $text[2]; ?>:</td>
 <td><input type="Password" name="passwort2" value="<?php echo $_POST['passwort2']; ?>" size="20" maxlength="30"></td>
</tr>
 
<tr>
 <td><?php echo $text[3]; ?></td>
 <td><input type="Text" name="geburtstag" value="<?php echo $_POST['geburtstag']; ?>" size="10" maxlength="10"></td>
</tr>

<tr>
 <td colspan="2"><input type="Submit" name="anmelden" value="<?php echo $text[6]; ?>"></td>
</tr>
</table>
</form>
<?php
  }
?>
</body>
</html>

this is the result on the site.
Zen - [PHP] Joomla question. - RaGEZONE Forums



Thanks.


Zen.
 
not that i know of. i have my own joomla, and i just have a separate page for my php.
if there is of some sort a php includer in joomla, put it up. =]] haha.
 
Back