Location: PHPKode > scripts > MySQL/HTML-Client > mysqlhtml-client/index.php
<?php
    include_once("config.inc.php");

    /**************************************************************************************
    *   MySQL/HTML-Client
    *   version     v0.9.3
    *   author:     e-voc [Uwe Pries] <e-hide@address.com>,
    *   co-author:  Andrew Kirilenko <hide@address.com>
    *   date:       2002-10-10
    ***************************************************************************************
    *   License:    Licensed under GPL [http://www.gnu.org/copyleft/gpl.html]
    ***************************************************************************************

    /** MySQL Column Types ************************/
        $type_array = array(
                                // INTEGERS
                                "TINYINT",
                                "SMALLINT",
                                "MEDIUMINT",
                                "INT",
                                "INTEGER",
                                "BIGINT",
                                // FLOATING POINT NUMBERS
                                "FLOAT",
                                "DOUBLE",
                                "DOUBLE PRECISION",
                                "REAL",
                                "DECIMAL",
                                "NUMERIC",
                                // DATE AND TIME
                                "DATE",
                                "DATETIME",
                                "TIMESTAMP",
                                "TIME",
                                "YEAR",
                                // CHAR AND TEXT
                                "CHAR",
                                "VARCHAR",
                                "TINYBLOB",
                                "TINYTEXT",
                                "BLOB",
                                "TEXT",
                                "MEDIUMBLOB",
                                "MEDIUMTEXT",
                                "LONGBLOB",
                                "LONGTEXT",
                                // SPECIAL
                                "ENUM",
                                "SET"
                           );
    /** MySQL Column Types *********************/

    /** MySQL Table Types *************************/
        $table_types = array(
                                "MYISAM",
                                "GEMINI",
                                "HEAP",
                                "ISAM",
                                "InnoDB",
                                "MERGE",
                                "BDB"
                            );
    /** MySQL Table Types **********************/

    /*********************************************************/

    if (!$conn)
        $conn = 0;

    if ($myaction_hidden == "login")
        unset($myaction_hidden);
?>
<html>
<head>
<title>MySQL/HTML-Client <?php echo VERSION; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="author" content="Uwe Pries">
<meta name="description" content="MySQL/HTML-Client @ http://www.judas-price.de">
</head>
<style type="text/css">
 .black { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; text-decoration: none; color: #000000; }
 .white { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; text-decoration: none; color: #FFFFFF; }
 .blacksmall { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; text-decoration: none; color: #000000; }
 .whitesmall { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; text-decoration: none; color: #FFFFFF; }

 a:link  { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; text-decoration: none; color: #234567 }
 a:visited  { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; text-decoration: none; color: #234567 }
 a:active  { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; text-decoration: none; color: #234567 }
 a:hover  { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; text-decoration: none; color: #FFFFFF }

 a.white:link  { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; font-weight: bold; text-decoration: none; color: #FFFFFF }
 a.white:visited  { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; font-weight: bold; text-decoration: none; color: #FFFFFF }
 a.white:active  { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; font-weight: bold; text-decoration: none; color: #FFFFFF }
 a.white:hover  { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; font-weight: bold; text-decoration: none; color: #789AB0 }

 th { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; font-weight: bold; color: #000000; text-decoration: none;}
 td { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: <?php echo FONTSIZE; ?>pt; font-weight: normal; color: #000000; text-decoration: none;}

 input, select, textarea  
 {
     BACKGROUND-COLOR: #789ABC;
     BORDER-BOTTOM: #234560 1px solid;
     BORDER-LEFT: #234560 1px solid;
     BORDER-RIGHT: #234560 1px solid;
     BORDER-TOP: #234560 1px solid; 
     COLOR: #000000; 
     font-family: Arial, Verdana, Helvetica, sans-serif; 
     font-size: <?php echo FONTSIZE; ?>pt; 
 }
 
 input.button
 {
     BACKGROUND-COLOR: #789ABC; 
     BORDER-BOTTOM: #234560 2px solid; 
     BORDER-LEFT: #234560 2px solid; 
     BORDER-RIGHT: #234560 2px solid; 
     BORDER-TOP: #234560 2px solid; 
     COLOR: #222222; 
     font-family: Arial, Verdana, Helvetica, sans-serif; 
     font-size:<?php echo (FONTSIZE - 1); ?>pt; 
     font-weight: bold; 
 }
 
 body 
 {
     scrollbar-DarkShadow-Color:#123450; 
     scrollbar-Track-Color:#123450; 
     scrollbar-Face-Color:#345670; 
     scrollbar-Shadow-Color:#123450; 
     scrollbar-Highlight-Color:#456780; 
     scrollbar-3dLight-Color:#345670; 
     scrollbar-Arrow-Color:#456780 
 }
         
<?php
    $style1 = "style = \"BACKGROUND-COLOR: #789ABC; BORDER-BOTTOM: #789ABC 1px solid; BORDER-LEFT: #789ABC 1px solid; BORDER-RIGHT: #789ABC 1px solid; BORDER-TOP: #789ABC 1px solid;\"";
    $style2 = "style = \"BACKGROUND-COLOR: #456789; BORDER-BOTTOM: #456789 1px solid; BORDER-LEFT: #456789 1px solid; BORDER-RIGHT: #456789 1px solid; BORDER-TOP: #456789 1px solid;\"";
    $style3 = "style = \"BACKGROUND-COLOR: #456789; BORDER-BOTTOM: #456789 1px solid; BORDER-LEFT: #456789 1px solid; BORDER-RIGHT: #456789 1px solid; BORDER-TOP: #456789 1px solid;\"";
    $style4 = "style = \"BACKGROUND-COLOR: #EEEEEE; BORDER-BOTTOM: #EEEEEE 1px solid; BORDER-LEFT: #EEEEEE 1px solid; BORDER-RIGHT: #EEEEEE 1px solid; BORDER-TOP: #EEEEEE 1px solid;\"";
    $style5 = "style = \"BACKGROUND-COLOR: #CCCCCC; BORDER-BOTTOM: #CCCCCC 1px solid; BORDER-LEFT: #CCCCCC 1px solid; BORDER-RIGHT: #CCCCCC 1px solid; BORDER-TOP: #CCCCCC 1px solid;\"";
    $style6 = "style = \"BACKGROUND-COLOR: #EEEEEE; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid;\"";
?>
</style>
<body bgcolor="#456789">
<script language="JavaScript">
<!--
    function checkDBL(radio_gruppe, i) {
        if (radio_gruppe[i-1].checked == true) {
            radio_gruppe[i-1].checked = false;
        }
    }

    function checkDropUnique(chckBox)
    {
        if (!chckBox.checked)
        {
            alert("To drop this UNIQUE KEY you'll have to DROP PRIMARY KEY!!!");
        }        
    }

    function promptMyAction(formObjectValue, promptForConfirm, promptMessage)
    {
        if (promptForConfirm)
        {
            if (!promptMessage)
            {
                promptMessage = "Are you sure to " + formObjectValue + " ?";
            }
            
            if (confirm(promptMessage))
            {
                document.clientform.myaction_hidden.value = formObjectValue;
                if (promptMessage == "Do you want to refresh this view (send last MySQL-Query)?")
                {
                    document.clientform.query_text.value = document.clientform.last_query.value;
                }
                document.clientform.submit();
            }
        }
        else
        {
            document.clientform.myaction_hidden.value = formObjectValue;
            document.clientform.submit();
        }
    }

    function setOrderBy(fieldname)
    {
        document.clientform.orderby.value = fieldname;
        document.clientform.submit();
        return true;
    }

    function openTo(what)
    {
        if (confirm('Are you sure to send output to ' + what.toUpperCase() + '?'))
        {
            document.clientform.action = "modules/to_" + what + ".<?php echo FILE_EXT; ?>";
            document.clientform.target = "_blank";
            document.clientform.submit();
    
            document.clientform.action = "index.<?php echo FILE_EXT; ?>";
            document.clientform.target = "";
        }
    }
//-->
</script>
<form action="index.<?php echo FILE_EXT; ?>" name="clientform" method="POST" enctype="multipart/form-data">
<input type="hidden" name="conn" value="<?php echo $conn; ?>">
<?php
    function mysql_client_error_msg(&$query_text, $file, $line)
    {
        ?>
        <p class="white">
            <b>Error in MySQL-Query</b><br>
            <b><li class="white"> in query</b>: <?php echo $query_text; ?><br>
            <b><li class="white"> in module</b>: <u><?php echo basename($file); ?></u> <b>on line</b>: <b><?php echo $line; ?></b><br><br>
            <b><li class="white"> server's comment</b>: <?php echo mysql_error(); ?><br><br>
            <a style="text-decoration: underline" class="white" href="javascript:history.go(-1)">back to previous screen</a>
        </p>
        </body>
        </html>
        <?php
    }

    function shortenText(&$text, $length, $delimiter_char) {
        return substr($text, 0, $length) . substr($text, $length, strpos(substr($text, $length), $delimiter_char) + 1);
    }

    if ($cfg_host[$conn])
        $host = $cfg_host[$conn];
    else
        echo "<input type=\"hidden\" name=\"host\" value=\"" . $host . "\">\n";

    if ($cfg_user[$conn])
        $user = $cfg_user[$conn];
    else
        echo "\t<input type=\"hidden\" name=\"user\" value=\"" . $user . "\">\n";

    if ($cfg_password[$conn])
        $password = $cfg_password[$conn];
    else
        echo "\t<input type=\"hidden\" name=\"password\" value=\"" . $password . "\">\n";

    if ($onlydatabase[$conn])
        $database = $onlydatabase[$conn];

    echo "<input type=\"hidden\" name=\"orderby\" value=\"\">\n";

    if ($myaction_hidden == "insert as new row")
    {
        $myaction_hidden = "insert";
    }
    else
    if (strstr($myaction_hidden, "mysql list"))
    {
        $mysql_list = $myaction_hidden;
        unset($myaction_hidden);
    }

    
?>
    <input type="hidden" name="database" value="<?php echo $database ?>">
    <input type="hidden" name="myaction_hidden" value="<?php echo $myaction_hidden ?>">
    <input type="hidden" name="last_query" value="<?php echo preg_replace("/\"/", "'", $query_text) ?>">
<?php
    $db_link = @mysql_connect($host, $user, $password);

    $query_text = trim($query_text);

    if ($myaction_hidden)
    {
        include_once("header.inc." . FILE_EXT);
        include_once("modules/" . ereg_replace("/| ", "_", $myaction_hidden) . ".inc." . FILE_EXT);
        include_once("footer.inc." . FILE_EXT);
    }
    else
    {
        include_once("modules/login.inc." . FILE_EXT);
    }
?>
</form>
<hr width="750" color="#DDDDDD" align="left">
<table border="0" width="750">
    <tr>
        <td align="center" class="white">
            <a href="mailto:e-hide@address.com">mail</a>&nbsp;|&nbsp;<a href="http://www.judas-price.de" target="_new">home</a>&nbsp;|&nbsp;<a href="http://www.mysql.com" target="_new">mysql</a><a href="http://www.mysql.com/doc" target="_new">/doc</a>
        </td>
    </tr>
</table>
<?php
    if ($db_link)
    {
?>
<script language="JavaScript">
    window.status="<?php 
        if ($database) 
        {
            echo "MySQL: " . $user . '@' .$host;
        }
    ?>";
</script>
<?php
        @mysql_close($db_link);
    }
?>
</body>
</html>
Return current item: MySQL/HTML-Client