我正在使用以下代码连接到运行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) 我有一个数据库(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循环,以便在页面上显示两个记录.
谢谢!