Home Backend Development PHP Tutorial 一看到这种程序就想抽写这种代码的人解决方案

一看到这种程序就想抽写这种代码的人解决方案

Jun 13, 2016 pm 01:15 PM
echo gt lt php quot

一看到这种程序就想抽写这种代码的人

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
if($server > 0)
{
    if(empty($dblist))
    {
        $dbs = mysql_list_dbs();
        $num_dbs = mysql_numrows($dbs);
    }
    else
    {
        $num_dbs = count($dblist);
    }

    for($i=0; $i
      <div id="el<?php echo $j;?>Parent" class="parent">
      <a class="item" href="db_details.php?server=<?php%20echo%20%24server;?>&db=<?php%20echo%20%24db;?>" onclick="expandIt('el<?php echo $j;?>'); return false;">
      <img src="/static/imghw/default1.png" data-src="images/plus.gif" class="lazy" name="imEx" border="0" alt="+"    style="max-width:90%"  style="max-width:90%" id="el<?php echo $j;?>Img"></a>
      <a class="item" href="db_details.php?server=<?php%20echo%20%24server;?>&db=<?php%20echo%20%24db;?>" onclick="expandIt('el<?php echo $j;?>');">
      <font color="black" class="heada">
    <?php echo $db;?>
      </font></a>
      </div>
      <div id="el<?php echo $j;?>Child" class="child">
    <?php $tables = mysql_list_tables($db);
    $num_tables = @mysql_numrows($tables);

    for($j=0; $j<$num_tables; $j++)
    {
        $table = mysql_tablename($tables, $j);
        ?>
            <nobr>    <a target="phpmain" href="sql.php?server=<?php%20echo%20%24server;?>&db=<?php%20echo%20%24db;?>&table=<?php%20echo%20urlencode(%24table);?>&sql_query=<?php%20echo%20urlencode(" select from>&pos=0&goto=tbl_properties.php"><img src="/static/imghw/default1.png" data-src="images/browse.gif" class="lazy" border="0" alt="<?php echo $strBrowse." :>"></a> <a class="item" target="phpmain" href="tbl_properties.php?server=<?php%20echo%20%24server;?>&db=<?php%20echo%20%24db;?>&table=<?php%20echo%20urlencode(%24table);?>"><?php echo $table;?></a></nobr><br>
        <?php 
Copy after login


要是随便给他改几个地方,不知道他自己能不能改好。

------解决方案--------------------
麻花代码 看起来就不爽
------解决方案--------------------
改一次麻烦一次,就这点?重写
------解决方案--------------------
这样的代码看起来比较乱,后期维护比较麻烦
------解决方案--------------------
别抽我,我写过.而且一写还写了好些年
------解决方案--------------------
我一直都是html和php分开写的
------解决方案--------------------
探讨

我一直都是html和php分开写的

------解决方案--------------------
全都是php tag & echo
应该是早期代码了
在2005年左右,这种代码风格最流行了
------解决方案--------------------
这样写的乱,看不出层次结构
如果把HTML和后台写在一起的话,就全用后台输出
这样结构清楚,后台解释输出也快
------解决方案--------------------
编码规范很重要滴
------解决方案--------------------
咳咳,
虽然说的确这样的代码不算好....不过, 如果你看到这样的代码就要抽人的话, 那你可抽的人多了...我也难逃厄运啊....

随便挑几个有点历史的开源php软件都能看到这样的代码.....

在OO被引进php之前,在smarty等模板流行之前,php就是这样的...

而且,在那个时候,这是作为一个"进步", 相对于perl等老式web编程需要大段大段输出的方式
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles