Location: PHPKode > scripts > No404s > install.php
<?php

error_reporting(E_ALL);

require 'index.php';

class installphp extends checklinksphp
{
    var $step; /* private */
    var $self; /* private */

    function installphp($everything)
    {
		parent::checklinksphp($everything);
        $step               = parent::allinput('step');
        $this->self         = $this->getserver('PHP_SELF');

        switch ($step)
        {
            case 'one':
                echo $this->one();
                break;
            default:
                echo $this->start();
                break;
        }

    }

    function start()
    {
        $this->lang->lang_istepstart = str_replace('%%steponeurl%%', $this->self .'?step=one', $this->lang->lang_istepstart);

        return '<p>'. $this->lang->lang_istepstart .'</p>';
    }

    function one()
    {
		error_reporting(E_ALL ^ E_NOTICE);
        $this->db->show_errors();
        $body   = '<p>'. $this->lang->lang_isteponeintro .'</p>';

        $sql    = "CREATE TABLE IF NOT EXISTS `". PREFIX ."` (
          `Link` varchar(200) NOT NULL default '',
          `LinkCode` varchar(5) NOT NULL default '',
          `LinkTitle` varchar(150) NOT NULL default '',
          `LinkTextCode` varchar(50) NOT NULL default '',
          `LinkError` varchar(150) NOT NULL default '',
          `numerrors` tinyint(3) NOT NULL default '0',
          `originatingurl` varchar(200) NOT NULL,
		  `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
          PRIMARY KEY  (`Link`)
        )";

        $info = $this->db->query($sql);

        $this->lang->lang_isteponeafter = str_replace('%%numqueries%%', 1, $this->lang->lang_isteponeafter);
        $this->lang->lang_isteponeafter = str_replace('%%steptwourl%%', $this->self .'?step=two', $this->lang->lang_isteponeafter);

        $body .= '<p>'. $this->lang->lang_isteponeafter .'</p>';

        return $body;
    }

}

    include 'header.inc.php';

    $sitephp   = new installphp($everything);

    include 'footer.inc.php';

?>   
Return current item: No404s