0

当我在我的网络服务器上运行这个 PHP 页面时,它不会在搜索按钮和文本框区域周围正确显示。

PHP 不是我的专长,所以如果有人可以为我投下他们熟练的眼睛并告诉我错误在哪里,这将是一个很大的帮助。

先感谢您...

<html>
<head>
</head>
<body vlink="#0000FF" alink="#0000FF"> 
<? include 'vars.php'; ?> 
<? include 'searchfunct.php'; ?> 
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0"   bgcolor="#66FFCC"> 
<tr> 
<td> <p align="center"> <font face="Arial"><a href="search.php">Search</a></font></p> 
  <form action="search.php" method="get"> 
    <div align="center"><font face="Arial"> 
      <input maxLength="100" size="60" value**="<?= htmlspecialchars(stripslashes($_GET["search"])); ?>" name="search">** 
      <input type="submit" value="Search" > 
      </p> 
      </font> </div> 
  </form></td> 
</tr> 
</table> 
<div align="left"> 
<?
$search=stripslashes($_GET["search"]);
$page=$_GET["page"];
if($search!="")
fSearch($search,$page,$server,$user,$pass,$database,$Logging,$ResultsPerPage);
?> 
</div> 
<br>
<br>
<div style="color:#CCCCCC; text-align:center;">Developed By Stefano Alimonti And  Stefano Fantin</div> 
</body>
</html>
4

3 回答 3

2

禁用 php 短标签可能是个问题

您可以替换 <?=<?php echo

<?<?php

于 2012-11-23T14:34:54.407 回答
1

正如<? and <?=php 的最新版本中已弃用的那样,我已将其替换为"<?php"and"<?php echo"

更新的 html 将是

<html>
<head>
</head>
<body vlink="#0000FF" alink="#0000FF"> 
<?php include 'vars.php'; ?> 
<?php include 'searchfunct.php'; ?> 
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0"   bgcolor="#66FFCC"> 
<tr> 
<td> <p align="center"> <font face="Arial"><a href="search.php">Search</a></font></p> 
  <form action="search.php" method="get"> 
    <div align="center"><font face="Arial"> 
      <input maxLength="100" size="60" value="<?php echo htmlspecialchars(stripslashes($_GET["search"])); ?>" name="search">** 
      <input type="submit" value="Search" > 
      </p> 
      </font> </div> 
  </form></td> 
</tr> 
</table> 
<div align="left"> 
<?php
$search=stripslashes($_GET["search"]);
$page=$_GET["page"];
if($search!="")
   fSearch($search,$page,$server,$user,$pass,$database,$Logging,$ResultsPerPage);
?> 
</div> 
<br>
<br>
<div style="color:#CCCCCC; text-align:center;">Developed By Stefano Alimonti And  Stefano Fantin</div> 
</body>
</html>

如果它仍然给出错误,请在评论中发布确切的错误

于 2012-11-23T14:38:54.580 回答
0

此标记看起来不正确:

<input maxLength="100" size="60" value**="<?= htmlspecialchars(stripslashes($_GET["search"])); ?>" name="search">**

尝试:

<input maxLength="100" size="60" value="**<?php htmlspecialchars(stripslashes($_GET['search'])); ?>**" name="search">
于 2012-11-23T14:42:13.323 回答