将图像变量从页面变为另一个

时间:2015-10-20 13:02:51

标签: php html sql

好的,我搜索了很多,没有任何帮助我。 我有这样的表格:

<form action="update.php" id="Form2" method="POST" enctype="multipart/form-data" class="c">
  <div align="center">
    <?php echo "Updating information about Patient ".$row["name"]; ?>
    <table class="imagetable" border="1" cellspacing="3"  align="center">
      <th>Personal Informations</th>
      <th>Test Results</th>

      <tr><td>Name<br>
          <input type="text" class="large-fld" name="name" placeholder="Patient Name" value="<?php echo $row['name'];?>"/></td>
        <td>Remarcs:<br>
          <textarea type="text" cols="40" rows="5" class="large-fld"  name="remarcs" placeholder="Remarcs"><?php echo $row['remarcs'];?></textarea></td>
      <tr><td>Address<br>
          <input type="text" class="large-fld" name="address" placeholder="Address" value="<?php echo $row['address'];?>"/>
        </td>
        <td>Test<br>  <textarea type="text" cols="40" rows="5" class="large-fld"  name="test_res" placeholder="Test Result"><?php echo $row['test_res'];?></textarea></td></tr>
      </td>
      </tr>
      <tr><td>Phone Number<br>
          <input type="text" class="large-fld" name="phone_num" placeholder="Phone Number" value="<?php echo $row['phone_num'];?>"/>
        </td>
        <th>Files</th>
      </tr>
      <td>Scanned Echo Photo<br>
        <input type="file" class="" name="echo_photo" id="echo_photo" placeholder="Add echo photo" value="<?php echo $row['echo_photo'];?>"/></td>
      <td>Echo Files:<br>
        <input type="file" name="fileToUpload"  value="<?php echo $row['echo_files'];?>"/><br></td>
      </tr></th></table>
    <div class="row" align="center">
      <input type="submit" name="submit" id="btnUploadId" class="large-btn" value="Update" onClick="btnOnClickUpload()">
      <input type="hidden" id="courseIdHidden" value="<?php echo $idd; ?>" /></td></tr>
      </table></div>
</form>

我无法将图像和文件放到下一页,使用它们来更新表格:

$host=""; // Host name 
$username=""; // Mysql username 
$password=""; // Mysql password 
$db_name=""; // Database name 
$tbl_name=""; // Table name 


$id=$_REQUEST['id'];
if (isset ($_POST['name'])) {
  $name = $_POST['name'];
}
if (isset ($_POST['remarcs'])) {
  $remarcs = $_POST['remarcs'];
}
if (isset ($_POST['test_res'])) {
  $test_res = $_POST['test_res'];
}
if (isset ($_POST['address'])) {
  $address = $_POST['address'];
} 

if (isset ($_POST['phone_num'])) {
  $phone = $_POST['phone_num'];
} 
echo $name;
echo $remarcs;
echo $test_res;

echo $address;
echo $phone;

这些变量的回声非常好 如何完成这项任务?请帮忙

1 个答案:

答案 0 :(得分:0)

您可以使用$ _SESSION变量来存储有关您文件的信息,以便您可以从不同的php文件访问它们