当前位置: 代码迷 >> PHP >> 初学者提问 :怎么把书名$bookname;填进去text 框中去
  详细解决方案

初学者提问 :怎么把书名$bookname;填进去text 框中去

热度:79   发布时间:2016-04-28 18:12:01.0
菜鸟提问 :如何把书名$bookname;填进去text 框中去


<html>
           <meta http-equiv="Content-Type" content="text/html; charset="utf-8" />
<title>Tour Information</title>
            <body>
            <h2>Mission Information</h2>
            <form action="formaction.php">
            <table width="100%">
            <tr><td>书名:</td><td><input type="text" name="ship" value='<?php include test.php; echo $result;  ?>' /></td></tr>
            <tr><td>Trip Date:</td><td><input type="text" name="tripdate" /></td></tr>
            <tr><td colspan="2">Mission Goals:</td></tr>
            <tr>
            <td><input type="checkbox" name="exploration" value="yes" />
            Exploration</td>
            <td><input type="checkbox" name="contact" value="yes" />
            Contact</td>
            </tr>
            <tr>
            <td valign="top">Crew species:  </td>
            <td>
            <select name="crew" multiple="multiple">
            <option value="xebrax">Xebrax</option>
            <option value="snertal">Snertal</option>
            <option value="gosny">Gosny</option>
            </select>
            </td>
            </tr>
            <tr><td colspan="2" align="center"><input type="submit" /></td></tr>
            </table>
            </form>
            </body>
 </html>
<?php 
//header('Content-Type:text/html; charset=utf-8');

$isbn   = '9787308083256';

$result = PIPHP_GetBookFromISBN($isbn);

function PIPHP_GetBookFromISBN($isbn)
{
   //echo header("Content-Type:text/html;charset=utf-8"); 

   $page2xml =   @simplexml_load_string($page);
   $booksummary=$page2xml->summary;

   
   //echo $booksummary;
   $bookname=$page2xml->title;

   return $bookname;
}
?>


如何把书名$bookname;填进去text 框中去
------解决思路----------------------
把php放在最上面(在echo $result;之前即可)
  相关解决方案