小编Chr*_*rus的帖子

Perl:使用HTML :: Entities错误

我正在使用以下代码连接到运行HTML页面的服务器:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 1st February 2005), see www.w3.org">

  <title>Calculator</title>
  <link type="text/css" rel="stylesheet" href="mystyle.css">
</head>

<body>
  <h1>Calculator</h1>

  <p>This is a calculator form that uses a CGI script.</p>

  <form method="post" action="./cgi-bin/badcalc.pl">
    Expression <input type="text" name="exp" size="10"> 
    <input type="submit" value="Calculate">
    <input type="reset">
  </form><br>

  <p>The cgi script that does the calculation may be viewed <a href=
  "cgi-bin/code2html.pl?file=badcalc.pl">here</a>.</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

这链接到包含代码的Perl文件:

#!/usr/bin/perl

use strict;
use warnings;
use Safe; #using Sandbox …
Run Code Online (Sandbox Code Playgroud)

html apache perl cgi

3
推荐指数
1
解决办法
1万
查看次数

而Loop使用PHP与MySQL服务器

我有一个数据库(SQL),其中包含"Staff"表,其中包含两个记录.我需要使用PHP在网页上显示这些记录的内容.

<html>
<head>
<title>CES Staff details</title>
</head>

<body>

**code emitted**

<?php
$row = mysql_fetch_array($result) ; 
$looping = 1;
$i = $row.length;
while ($looping <= $i)  
    {
        echo $row["Name"].", Room ".$row["Room"].", Tel ".$row["Telephone"] ;
        $looping++;
    }
?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

如何正确更改while循环,以便在页面上显示两个记录.

谢谢!

html php mysql sql while-loop

2
推荐指数
1
解决办法
5万
查看次数

标签 统计

html ×2

apache ×1

cgi ×1

mysql ×1

perl ×1

php ×1

sql ×1

while-loop ×1