cari
Rumahpembangunan bahagian belakangtutorial php 一看到这种程序就想抽写这种代码的人解决方案

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

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/imghwm/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/imghwm/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 


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

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

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

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

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

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

而且,在那个时候,这是作为一个"进步", 相对于perl等老式web编程需要大段大段输出的方式
Kenyataan
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
php怎么把负数转为正整数php怎么把负数转为正整数Apr 19, 2022 pm 08:59 PM

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php怎么实现几秒后执行一个函数php怎么实现几秒后执行一个函数Apr 24, 2022 pm 01:12 PM

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php怎么除以100保留两位小数php怎么除以100保留两位小数Apr 22, 2022 pm 06:23 PM

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

php怎么根据年月日判断是一年的第几天php怎么根据年月日判断是一年的第几天Apr 22, 2022 pm 05:02 PM

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php怎么判断有没有小数点php怎么判断有没有小数点Apr 20, 2022 pm 08:12 PM

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

php怎么替换nbsp空格符php怎么替换nbsp空格符Apr 24, 2022 pm 02:55 PM

方法:1、用“str_replace("&nbsp;","其他字符",$str)”语句,可将nbsp符替换为其他字符;2、用“preg_replace("/(\s|\&nbsp\;||\xc2\xa0)/","其他字符",$str)”语句。

php怎么设置implode没有分隔符php怎么设置implode没有分隔符Apr 18, 2022 pm 05:39 PM

在PHP中,可以利用implode()函数的第一个参数来设置没有分隔符,该函数的第一个参数用于规定数组元素之间放置的内容,默认是空字符串,也可将第一个参数设置为空,语法为“implode(数组)”或者“implode("",数组)”。

php字符串有没有下标php字符串有没有下标Apr 24, 2022 am 11:49 AM

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。

See all articles

Alat AI Hot

Undresser.AI Undress

Undresser.AI Undress

Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover

AI Clothes Remover

Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool

Undress AI Tool

Gambar buka pakaian secara percuma

Clothoff.io

Clothoff.io

Penyingkiran pakaian AI

AI Hentai Generator

AI Hentai Generator

Menjana ai hentai secara percuma.

Alat panas

Dreamweaver CS6

Dreamweaver CS6

Alat pembangunan web visual

Hantar Studio 13.0.1

Hantar Studio 13.0.1

Persekitaran pembangunan bersepadu PHP yang berkuasa

Penyesuai Pelayan SAP NetWeaver untuk Eclipse

Penyesuai Pelayan SAP NetWeaver untuk Eclipse

Integrasikan Eclipse dengan pelayan aplikasi SAP NetWeaver.

mPDF

mPDF

mPDF ialah perpustakaan PHP yang boleh menjana fail PDF daripada HTML yang dikodkan UTF-8. Pengarang asal, Ian Back, menulis mPDF untuk mengeluarkan fail PDF "dengan cepat" dari tapak webnya dan mengendalikan bahasa yang berbeza. Ia lebih perlahan dan menghasilkan fail yang lebih besar apabila menggunakan fon Unicode daripada skrip asal seperti HTML2FPDF, tetapi menyokong gaya CSS dsb. dan mempunyai banyak peningkatan. Menyokong hampir semua bahasa, termasuk RTL (Arab dan Ibrani) dan CJK (Cina, Jepun dan Korea). Menyokong elemen peringkat blok bersarang (seperti P, DIV),

Muat turun versi mac editor Atom

Muat turun versi mac editor Atom

Editor sumber terbuka yang paling popular