borlandsoftware 发表于 2004-8-23 11:39:30

一个php问题

一个php问题
<?php
if (isset($_POST['action']) && $_POST['action'] == 'submitted') {
    print '<pre>';

    print_r($_POST);
    print '<a href="'. $_SERVER['PHP_SELF'] .'">Please try again</a>';

    print '</pre>';
} else {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
    Name:<input type="text" name="personal"><br>
    Email: <input type="text" name="personal"><br>
    Beer: <br>
    <select multiple name="beer[]">
      <option value="warthog">Warthog</option>
      <option value="guinness">Guinness</option>
      <option value="stuttgarter">Stuttgarter Schwabenbr漉</option>
    </select><br>
    <input type="hidden" name="action" value="submitted">
    <input type="submit" name="submit" value="submit me!">
</form>
<?php
}
?>
如果要显示personal变量,如何写? :-D

jiangtao9999 发表于 2004-8-23 14:55:20


Name: <input type="text" name="personal"><br>
Email: <input type="text" name="personal"><br>

Name: <input type="text" name="<?=$personal['name'] ?>"><br>
Email: <input type="text" name="<?=$personal['email'] ?>"><br>
页: [1]
查看完整版本: 一个php问题