Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html表在php代码中不回显_Php - Fatal编程技术网

Html表在php代码中不回显

Html表在php代码中不回显,php,Php,我正在制作一个注册表单,我试图将表单输出到与php代码相同的页面上。它不起作用。我正在使用echo,但没有显示任何内容。所有代码看起来都正常,但什么都没有。谢谢你的帮助 <?php include("../includes/header.php"); // Begin Create new user function // Variables that data come from the submission form $username = $_POST["user"]

我正在制作一个注册表单,我试图将表单输出到与php代码相同的页面上。它不起作用。我正在使用echo,但没有显示任何内容。所有代码看起来都正常,但什么都没有。谢谢你的帮助

<?php include("../includes/header.php"); 
  // Begin Create new user function

  // Variables that data come from the submission form
  $username = $_POST["user"];      // Username that will be MD5'ed
  $usernamereal = $_POST["user"];  // Username
  $password = $_POST["pass"];      // Password that will be MD5'ed
  $name =  $_POST["name"];         // Name
  $address = $_POST["address"];    // Address
  $suburb = $_POST["suburb"];      // Suburb
  $state = $_POST["state"];        // State
  $postcode = $_POST["postcode"];  // Postcode
  $phone1 = $_POST["phone1"];      // Phone Number 1
  $phone2 = $_POST["phone2"];      // Phone Number 2
  $emailaddress = $_POST["email"]; // Email Address

  // Get IP Address of user
  $ipaddress = $_SERVER["REMOTE_ADDR"];

  /* Check if all the sections are completed as a whole, then if one isn't
  filled out display the error message for that/those particular variables. */

  if ((!$username) || (!$password) || (!$name) || (!$address) || (!$suburb) || (!$state) || (!$postcode) || (!$phone1) || (!$phone2) || (!$emailaddress)) {
      echo "You didn't submit the following required information:<br><br>";

      if(!$username) {
          echo "Please enter a username<br>";
          }
      if (!$password) {
          echo "Please enter a password<br>";
      }
      if (!$name) {
          echo "Please enter a name<br>";
      }
      if (!$address) {
          echo "Please enter a address<br>";
      }
      if (!$suburb) {
          echo "Please enter a suburb<br>";
      }
      if (!$state) {
          echo "Please enter a state<br>";
      }
      if (!$postcode) {
          echo "Please enter a postcode<br>";
      }
      if (!$phone1) {
          echo "Please enter a phone number for phone number 1<br>";
      }
      if (!$phone2) {
          echo "Please enter a phone number for phone number 2<br>";
      }
      if (!$emailaddress) {
          echo "Please enter a email address<br>";
      }

      exit(); // If there are errors then we quit this script
  }

  // Check if postcode is a numeric
  if ((!is_numeric($postcode))) {
        echo "Please enter a postcode";
        exit();
  }

  // Check if phone number 1 is a numeric
  if ((!is_numeric($phone1))) {
        echo "Please enter a phone number for phone number 1";
        exit();
  }

  // Check if phone number 2 is a numeric
  if ((!is_numeric($phone2))) {
        echo "Please enter a phone number for phone number 2";
        exit();
  }

  // Use Connect Script
  include("connect.php");

  // Get date from MySQL Server
  $currentdatetime = mysql_query('select now()');
  $curdatetime = mysql_result($currentdatetime,0);

  /* Check if username exists. If not then add all data to the database.
  If so then ask user for another name to try. */

  // MD5 Username and Password
  $username = MD5($username);
  $password = MD5($password);

  // Check if the username exists
  $usernameinuse = mysql_query("SELECT * FROM userdata WHERE userid = '$username'");
  $isusernameinuse = mysql_num_rows($usernameinuse);

  // If username exists then print error message and exit script
  if ($isusernameinuse == 1) {
      echo "The username you selected is already been used by another member.<BR>Go back and select a new username";
      exit;
  }

  else {

      // Find out how many users there are so that you can determine the next user number
      $usercount = mysql_query("SELECT * FROM userdata");
      $noofusers = mysql_num_rows($usercount);

      // New user number = User number + 1
      $usernumber = $noofusers + 1;

      // Insert the new user to the database since everything is fine
      mysql_query("INSERT INTO userdata VALUES ('$username','$password','$name','$address','$suburb','$state','$postcode','$phone1','$phone2','$emailaddress','$curdatetime','$ipaddress','$usernumber','$usernamereal')");

      // Print Successful Creation of user message
      echo "User " . $usernamereal . " has been created successfully.<BR>Click login at the top to login.";

  }

    echo "
<div class='main-content-wrap'>
    <div class='main-content'>
        <h1>CREATE YOUR ACCOUNT:</h1>

        <div id='main'>
            <div id='regbox'>
                <form name='newUser' action='".$_SERVER['PHP_SELF']."' method='post'>
                    <table border='0' width='100%' id='table1' height='321'>
                        <tr>
                            <td width='115'><font face='Tahoma'>Email</font></td>
                            <td> <input type='text' name='email' /></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>Password</font></td>
                            <td> <input type='password' name='pass' maxlength='15' /></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>First Name</font></td>
                            <td> <input type='text' name='fname' /></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>Last Name</font></td>
                            <td> <input type='text' name='lname' /></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>Phone</font></td>
                            <td> <input type='text' name='phone' maxlength='10'/></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>Username:</font></td>
                            <td> <input type='text' name='username' maxlength='15'/></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>ZNZ Single ID</font></td>
                            <td> <input type='text' name='znzasid' /></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>ZNZ Double ID</font></td>
                            <td> <input type='text' name='znzdid' /></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>Empower Network ID</font></td>
                            <td> <input type='text' name='enid' /></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>ZNZADTEAM LINK</font></td>
                            <td> <input type='text' name='znztl' maxlength='5'/></td>
                        </tr>
                        <tr>
                            <td width='115'><font face='Tahoma'>Verification</font></td>
                            <td> <input type='text' name='captcha'/></td>
                        </tr>
                        <tr>
                            <td width='115' height='44'>&nbsp;</td>
                            <td height='44'> <input type='submit' value='Create User'>
                    <input type='reset' value='Reset'></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>

你的div是无与伦比的。您有4个开始div,只有3个结束div。

您是否查看了页面的源代码?你看到了什么?当你做
IF(Boolean)
创建一个
ELSE
并输出错误消息时,如果你只是把
放进去,它会显示什么吗?这段代码将得到致命剂量的SQL注入。当你做IF(Boolean)时创建ELSE并输出错误消息。执行此操作时未显示任何错误。否我的所有结束div都在那里查看网站her:
include("../includes/footer.php"); ?>