当前位置: 代码迷 >> PHP >> PHP 表单传递参数与获取参数有关问题
  详细解决方案

PHP 表单传递参数与获取参数有关问题

热度:450   发布时间:2016-04-28 18:50:55.0
PHP 表单传递参数与获取参数问题
<html>
<head><title>Register</title></head>
<body>
<?php
if (!isset($_POST['register1']) || ( $_POST['register1'] != 'Register'))
{
#echo "test1";
?>
<h1>Registration</h1>
<form method = "post" action = "register.php">
<table>
<tr><td>E-mail address:</td>
<td><input type='text' name = 'email'/></td>
</tr>
<tr><td>First Name:</td>
<td><input type = 'text' name = 'first_name'/></td>
</tr>
<tr><td>Last Name:</td>
<td><input type = 'text' name = 'last_name'/></td>
</tr>
<tr><td>PassWord:</td>
<td><input type = 'password' name = 'password'/></td>
</tr>

<tr>
<td colspan = '2'>
<input type = 'submit' name = 'register1' value = 'Register'/>
</td>
</tr>
</table>
</form>
<?php
}
else
{
?>
E-mail:
<?php 
echo $_POST['email']; 
?>
<br />
Name:
<?php 
echo $_POST['last_name']; 
?>
<br />
Password:
<?php 
echo $_POST['password']; 
?>
<?php
}
?>
</body>
</html>


初学 PHP 问个问题 在这里 获取
E-mail:
<?php 
echo $_POST['email']; 
?>
<br />
Name:
<br />
Password:

这些信息时 只输出一个没问题 
当我输出多个的时候像这个样子的
E-mail:
<?php 
echo $_POST['email']; 
?>
<br />
Name:
<?php 
echo $_POST['last_name']; 
?>
<br />
Password:
<?php 
echo $_POST['password']; 
?>
他就出错了 - -!!!
总是出现
An error occurred.

Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx.
这个东西 只输出一个时就可以
各位大神请指教 
------解决方案--------------------
<html>
<head><title>Register</title></head>
<body>
    <?php
    if (!isset($_POST['register1']) 
------解决方案--------------------
 ( $_POST['register1'] != 'Register'))
    {
            #echo "test1";
    ?>
    <h1>Registration</h1>
    <form method = "post" action = "">
        <table>
            <tr><td>E-mail address:</td>
                <td><input type='text' name = 'email'/></td>
            </tr>
            <tr><td>First Name:</td>
                <td><input type = 'text' name = 'first_name'/></td>
            </tr>
            <tr><td>Last Name:</td>
                <td><input type = 'text' name = 'last_name'/></td>
            </tr>
            <tr><td>PassWord:</td>
                <td><input type = 'password' name = 'password'/></td>
            </tr>
 
            <tr>
                <td colspan = '2'>
                    <input type = 'submit' name = 'register1' value = 'Register'/>
                </td>
  相关解决方案