[HELP] Kalonline Website

Results 1 to 12 of 12
  1. #1
    Enthusiast Swaty_1337 is offline
    MemberRank
    May 2008 Join Date
    31Posts

    [HELP] Kalonline Website

    Ive downloaded a homepage, because i cant make one by myselfe ...
    I put it into xampp\htdocs
    I started xampp go in my browser to http://localhost/install.php
    and want to log in

    DBHost : localhost
    DBUsername : sa
    DBPassword : and my pw

    Object Not Found 404 Error or so ...
    Why didnt it install the tables on my db ?

    (my mssql 2000 server is on the same computer )

    Here is the install.php

    PHP Code:
    <?
    if ($_GET['step'] == ""){
    echo 
    '<form action="new.php?step=2" method="post">
    DB Host: <input type="text" name="host" value="localhost" /><br/>
    Db Username: <input type="text" name="user" value="sa" /><br/>
    DB Password: <input type="text" name="pw" /><br/>
    <input type="submit" value="OK" />
    </form>'
    ;
    } else if (
    $_GET['step'] == "2"){

    $content "<?
    if (ALLOW_OPEN != 1){
        exit(\"<strong>Error: </strong>Can't be opened directly!\");
    }
    // MSSQL Database Info
    \$connect = mssql_connect(\""
    .$_POST['host']."\",\"".$_POST['user']."\",\"".$_POST['pw']."\");
    ?>"
    ;
    $filename "dbconnect.php";
    $handle fopen($filename'r+');
    if (
    fwrite($handle$content) === FALSE) {
           echo 
    "Cannot write to file {$filename}";
           exit;
          }
          
    fclose($handle);
          
    define(ALLOW_OPEN1);
    @include(
    "dbconnect.php");
    mssql_select_db("kal_auth");
    mssql_query("ALTER TABLE [Login] ADD [Admin] int");
    mssql_query("ALTER TABLE [Login] ADD [IP] varchar(20)");
    mssql_query("ALTER TABLE [Login] ADD [SN] varchar(15)");
    mssql_query("CREATE TABLE [site_about] (
        [id] [int] IDENTITY (1, 1) NOT NULL ,
        [content] [varchar] (8000) COLLATE Danish_Norwegian_BIN NULL 
    ) ON [PRIMARY]"
    ) or exit("Failed");
    mssql_query("INSERT INTO site_about (content) VALUES ('Your rules here')");
    mssql_query("CREATE TABLE [site_config] (
        [sitename] [varchar] (70) COLLATE Korean_Wansung_CS_AS NULL ,
        [enable_serverstatus] [char] (1) COLLATE Korean_Wansung_CS_AS NULL CONSTRAINT [DF_site_config_enable_serverstatus] DEFAULT (1),
        [enable_gmblock] [char] (1) COLLATE Korean_Wansung_CS_AS NULL CONSTRAINT [DF_site_config_enable_gmblock] DEFAULT (1),
        [allow_register] [char] (1) COLLATE Korean_Wansung_CS_AS NULL CONSTRAINT [DF_site_config_allow_register] DEFAULT (1),
        [enable_store] [char] (1) COLLATE Korean_Wansung_CS_AS NULL CONSTRAINT [DF_site_config_enable_store1] DEFAULT (1),
        [exprate] [varchar] (5) COLLATE Korean_Wansung_CS_AS NULL ,
        [droprate] [varchar] (5) COLLATE Korean_Wansung_CS_AS NULL ,
        [questrate] [varchar] (5) COLLATE Korean_Wansung_CS_AS NULL 
    ) ON [PRIMARY]"
    ) or exit("Failed");
    mssql_query("INSERT INTO site_config (sitename, enable_serverstatus, enable_gmblock, allow_register, enable_store, exprate, droprate, questrate) VALUES ('Sitename','1','1','1','1','1','1','1')");
    mssql_query("CREATE TABLE [site_download] (
        [id] [int] IDENTITY (1, 1) NOT NULL ,
        [link] [varchar] (50) COLLATE Korean_Wansung_CS_AS NULL ,
        [name] [varchar] (60) COLLATE Korean_Wansung_CS_AS NULL ,
        [version] [varchar] (50) COLLATE Korean_Wansung_CS_AS NULL ,
        [descr] [varchar] (1000) COLLATE Danish_Norwegian_BIN NULL 
    ) ON [PRIMARY]"
    ) or exit("Failed");
    mssql_query("CREATE TABLE [site_ipban] (
        [id] [int] IDENTITY (1, 1) NOT NULL ,
        [ip] [varchar] (20) COLLATE Korean_Wansung_CS_AS NOT NULL 
    ) ON [PRIMARY]"
    ) or exit("Failed");
    mssql_query("CREATE TABLE [site_news] (
        [id] [int] IDENTITY (1, 1) NOT NULL ,
        [subject] [varchar] (80) COLLATE Danish_Norwegian_BIN NULL ,
        [wroteby] [varchar] (50) COLLATE Danish_Norwegian_BIN NULL ,
        [wrotedate] [varchar] (50) COLLATE Danish_Norwegian_BIN NULL ,
        [content] [varchar] (8000) COLLATE Danish_Norwegian_BIN NULL 
    ) ON [PRIMARY]"
    ) or exit("Failed");
    mssql_query("CREATE TABLE [site_rules] (
        [id] [int] IDENTITY (1, 1) NOT NULL ,
        [content] [varchar] (8000) COLLATE Danish_Norwegian_BIN NULL 
    ) ON [PRIMARY]
    "
    ) or exit("Failed");
    mssql_query("INSERT INTO site_rules (content) VALUES ('Your rules here')");
    mssql_query("CREATE TABLE [site_store] (
        [id] [varchar] (5) COLLATE Korean_Wansung_CS_AS NOT NULL ,
        [name] [varchar] (80) COLLATE Korean_Wansung_CS_AS NULL ,
        [price] [varchar] (50) COLLATE Korean_Wansung_CS_AS NULL ,
        CONSTRAINT [PK_site_store] PRIMARY KEY  CLUSTERED 
        (
            [id]
        )  ON [PRIMARY] 
    ) ON [PRIMARY]"
    ) or exit("Failed");

    echo 
    "Do you already have a user on the server?";
    echo 
    '<form action="new.php?step=3" method="post">
    Yes <input type="radio" name="haveuser" value="yes" /><br/>
    No <input type="radio" name="haveuser" value="no" /><br/>
    <input type="submit" value="OK" />
    </form>'
    ;
    } else if (
    $_GET['step'] == "3"){
    if (
    $_POST['haveuser'] == "yes"){
    echo 
    '<form action="new.php?step=4" method="post">
    Please enter the username of your account:<br/>
    <input type="text" name="user" /><br/>
    <input type="hidden" name="haveuser" value="yes" /><br/>
    <input type="submit" value="OK" />
    </form>'
    ;
    } else if (
    $_POST['haveuser'] == "no"){
    echo 
    '<form action="new.php?step=4" method="post">
    Please enter a username and password you want for your server:<br/>
    Username: <input type="text" name="user" /><br/>
    Password: <input type="password" name="password" /><br/>
    <input type="hidden" name="haveuser" value="no" /><br/>
    <input type="submit" value="OK" />
    </form>'
    ;
    }
    } else if (
    $_GET['step'] == "4"){
    if (
    $_POST['haveuser'] == "no"){
    define(ALLOW_OPEN1);
    @include(
    "dbconnect.php");
    mssql_select_db("kal_auth");
    function 
    passConvert($password)
    {
        
    $encar = array('!'=>'95''"'=>'88''#'=>'9D''$'=>'4C''%'=>'F2''&'=>'3E''\''=>'BB''('=>'C0'')'=>'7F''*'=>'18''+'=>'70'','=>'A6''-'=>'E2''.'=>'EC''/'=>'77',
                            
    '0'=>'2C''1'=>'3A''2'=>'4A''3'=>'91''4'=>'5D''5'=>'7A''6'=>'29''7'=>'BC''8'=>'6E''9'=>'D4'':'=>'40'';'=>'17''<'=>'2E''='=>'CB''>'=>'72''?'=>'9C',
                            
    '@'=>'A1''A'=>'FF''B'=>'F3''C'=>'F8''D'=>'9B''E'=>'50''F'=>'51''G'=>'6D''H'=>'E9''I'=>'9A''J'=>'B8''K'=>'84''L'=>'A8''M'=>'14''N'=>'38''O'=>'CE',
                            
    'P'=>'92''Q'=>'5C''R'=>'F5''S'=>'EE''T'=>'B3''U'=>'89''V'=>'7B''W'=>'A2''X'=>'AD''Y'=>'71''Z'=>'E3''['=>'D5''\\'=>'BF'']'=>'53''^'=>'28''_'=>'44',
                            
    '`'=>'33''a'=>'48''b'=>'DB''c'=>'FC''d'=>'09''e'=>'1F''f'=>'94''g'=>'12''h'=>'73''i'=>'37''j'=>'82''k'=>'81''l'=>'39''m'=>'C2''n'=>'8D''o'=>'7D',
                            
    'p'=>'08''q'=>'4F''r'=>'B0''s'=>'FE''t'=>'79''u'=>'0B''v'=>'D6''w'=>'23''x'=>'7C''y'=>'4B''z'=>'8E''{'=>'06''|'=>'5A''}'=>'CC''~'=>'62');

        
    $newpass "0x";                                  
        for (
    $i 0$i strlen($password); $i++)
        {
            
    $newpass .= $encar[$password[$i]];
        }                    
        
        return 
    $newpass;  
    }
    function 
    randomkeys($length)
    {
      
    $pattern "1234567890abcdefghijklmnopqrstuvwxyz";
      for(
    $i=0;$i<$length;$i++)
      {
       if(isset(
    $key))
         
    $key .= $pattern{rand(0,35)};
       else
         
    $key $pattern{rand(0,35)};
      }
      return 
    $key;
    }

    $login stripslashes($_POST['user']);
    $pw stripslashes($_POST['password']);
    $password passConvert($pw);
    mssql_query("INSERT INTO Login ([ID], [PWD], [Birth], [Type], [ExpTime], [Admin], [IP], [SN]) VALUES ('".$login."',".$password.",'".$birthday."','0','4000','11','".$_SERVER['REMOTE_ADDR']."','".$sn."')");
    $query mssql_query("SELECT * FROM [Login] WHERE [SN] = ''");
    while(
    $r mssql_fetch_array($query)){
    $sn randomkeys(15);
    mssql_query("UPDATE [Login] SET [SN] = '".$sn."' WHERE [UID] = '".$r['UID']."'");
    }
    echo 
    'You are now ready to enter your site. The install.php file will be deleted, but just to be safe, you better take a look.';
    unlink("new.php");
    } else if (
    $_POST['haveuser'] == "yes"){
    define(ALLOW_OPEN1);
    @include(
    "dbconnect.php");
    mssql_select_db("kal_auth");
    function 
    randomkeys($length)
    {
      
    $pattern "1234567890abcdefghijklmnopqrstuvwxyz";
      for(
    $i=0;$i<$length;$i++)
      {
       if(isset(
    $key))
         
    $key .= $pattern{rand(0,35)};
       else
         
    $key $pattern{rand(0,35)};
      }
      return 
    $key;
    }
    $sn randomkeys(15);
    mssql_query("UPDATE [Login] SET [Admin] = '11',[IP] = '".$_SERVER['REMOTE_ADDR']."',[SN] = '".$sn."' WHERE [ID] = '".$_POST['user']."'");
    $query mssql_query("SELECT * FROM [Login] WHERE [SN] = ''");
    while(
    $r mssql_fetch_array($query)){
    $sn randomkeys(15);
    mssql_query("UPDATE [Login] SET [SN] = '".$sn."' WHERE [UID] = '".$r['UID']."'");
    }
    echo 
    'You are now ready to enter your site. The install.php file will be deleted, but just to be safe, you better take a look.';
    unlink("new.php");
    }
    }
    ?>


  2. #2
    Account Upgraded | Title Enabled! mukso is offline
    MemberRank
    Nov 2007 Join Date
    HungaryLocation
    333Posts

    Re: [HELP] Kalonline Website

    try with your ip, so no localhost/install.php just type your ip :)

  3. #3
    Enthusiast Swaty_1337 is offline
    MemberRank
    May 2008 Join Date
    31Posts

    Re: [HELP] Kalonline Website

    Okay ... Ive taken another website ...

    Ive uploaded it and then Ive clicked on register

    Fatal error: Call to undefined function mssql_connect() in /usr/export/www/hosting/***/register.php on line 86

    mssql_connect('***.dnsdojo.com') or die('mist');
    mssql_select_db('kal_auth') or die('kack');

    I also get an answer when I ping ***.dnsdojo.com

    ( We've got an router . At the router are 4 pc's. One of them is mine and on this pc is the database. Ive uploaded the site at www.ohost.de )
    Last edited by Swaty_1337; 26-05-08 at 08:36 PM.

  4. #4
    Valued Member avihai1 is offline
    MemberRank
    Nov 2007 Join Date
    108Posts

    Re: [HELP] Kalonline Website

    amm i think you need to change the mssql login, but why do you want a site tht uses mssql? its kinda complicated, i would rather a simple site, or use mysql i think its easier

  5. #5
    Enthusiast Swaty_1337 is offline
    MemberRank
    May 2008 Join Date
    31Posts

    Re: [HELP] Kalonline Website

    I have no idea of php ...
    you need to change the mssql login,
    what should I change ?


    This way ?
    PHP Code:
    <?php

    //connect to a DSN "myDSN"
    $conn odbc_connect('myDSN','','');

    if (
    $conn)
    {
      
    //the SQL statement that will query the database
      
    $query "select * from cars";
      
    //perform the query
      
    $result=odbc_exec($conn$query);

      echo 
    "<table border=\"1\"><tr>";

      
    //print field name
      
    $colName odbc_num_fields($result);
      for (
    $j=1$j<= $colName$j++)
      { 
        echo 
    "<th>";
        echo 
    odbc_field_name ($result$j );
        echo 
    "</th>";
      }

      
    //fetch tha data from the database
      
    while(odbc_fetch_row($result))
      {
        echo 
    "<tr>";
        for(
    $i=1;$i<=odbc_num_fields($result);$i++) 
        {
          echo 
    "<td>";
          echo 
    odbc_result($result,$i);
          echo 
    "</td>";
        }
        echo 
    "</tr>";
      }

      echo 
    "</td> </tr>";
      echo 
    "</table >";

      
    //close the connection
      
    odbc_close ($conn);
    }
    else echo 
    "odbc not connected";
    ?>

  6. #6
    Valued Member avihai1 is offline
    MemberRank
    Nov 2007 Join Date
    108Posts

    Re: [HELP] Kalonline Website

    ammm this php connects to your odbc :/ and i dont know anything about it :/ anyway if you give me the whole webiste i might change some things so it wont need the mssql and you will add stuff manually by editing the codr (not so complicated)

  7. #7
    Enthusiast Swaty_1337 is offline
    MemberRank
    May 2008 Join Date
    31Posts

    Re: [HELP] Kalonline Website


  8. #8
    Valued Member avihai1 is offline
    MemberRank
    Nov 2007 Join Date
    108Posts

    Re: [HELP] Kalonline Website

    ok, now i have a lot of exams so maybe in saturday i will be able to edit the site and upload it to you.

  9. #9
    Enthusiast Swaty_1337 is offline
    MemberRank
    May 2008 Join Date
    31Posts

    Re: [HELP] Kalonline Website

    Ty.
    Btw which php version is it ? someone in a php forum asked me about it ...

  10. #10
    Member KalFusion is offline
    MemberRank
    Feb 2008 Join Date
    C:\Billy\Website Design\Home\xD\index.htmlLocation
    76Posts

    Re: [HELP] Kalonline Website

    add me to msn, i can help you with any PHP and website scripting u need

    billycrid@hotmail.co.uk

    Thank

  11. #11
    Valued Member avihai1 is offline
    MemberRank
    Nov 2007 Join Date
    108Posts

    Re: [HELP] Kalonline Website

    ammmm are you using wamp server???????? cuz if u do, this program does not support mssql, only xampp or other programs that i dont know.

  12. #12
    boo General is offline
    MemberRank
    Sep 2006 Join Date
    at homeLocation
    2,269Posts

    Re: [HELP] Kalonline Website

    <form action="new.php?step=2" method="post">

    Call your file new.php instead of install.php when you submit the form to new.php ...



Advertisement