Jump to content

do-rami

New Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

do-rami's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. actually i'm totally new and i dont know how can i fix my code I'm trying to fetch data from different sql table for eg: allergies table, health record table if there is data available in that table then display whole page with pdf option if not then display full page only "no records found"
  2. <body> <div class="header"> <?php include('navbar.php'); ?> </div> <div class="container"> <div class="row mt-4"> <div class="col-sm-3"> <p>Patient Name :</p> </div> <div class="col-sm-3"> <p><?php echo $_POST['name']; ?></p> </div> </div> <div class="row" id="fir"> <div class="col-sm-3"> <p>UHID :</p> </div> <div class="col-sm-3"> <p><?php echo $_POST['id']; ?></p> </div> </div> <?php $_SESSION['p_name'] = $_POST['name']; $_SESSION['p_id'] = $_POST['id']; ?> <form action="personal_medical_record_download.php" method="POST"> <div class="form-header mt-4 text-center">Medical Record</div> <div class="card"> <div class="card-header"> <h2>Any Allergies</h2> </div> <div class="card-body"> <?php $uhid = $_SESSION['p_id']; $conn = mysqli_connect("127.0.0.1", "root", "iMpAcTHeaLTH7%", 'threephih'); $query = " Select * from allergies where uhid = '$uhid' "; $query_res = mysqli_query($conn, $query); while ($query_run = mysqli_fetch_array($query_res)) { ?> <div class="form-group"> <label for="1">1. Are you allergic to any substance?</label> <p style="margin-left: 25px"><?php echo $query_run['ques_1']; ?></p> </div> <div class="form-group"> <label for="2">2. What happened to you when you took this substance?</label> <p style="margin-left: 25px"><?php echo $query_run['ques_2']; ?></p> </div> <div class="form-group"> <label for="3">3. When was this reaction?</label> <p style="margin-left: 25px"><?php echo $query_run['ques_3']; ?></p> </div> <div class="form-group"> <label for="4">4. Since when have you taken that substance?</label> <p style="margin-left: 25px"><?php echo $query_run['ques_4']; ?></p> </div> <div class="form-group"> <label for="5">5. Any other kind of allergies?</label> <p style="margin-left: 25px"><?php echo $query_run['ques_5']; ?></p> </div> <?php } ?> </div> </div> <div class="submit-button mt-4 text-center"> <button type="submit" value="Pdf" name="pdf">PDF</button> </div> </form> </div> </body> I'm trying to show that "No records" message when there are no data in sql table but if there is data then go to the pdf page. please help me
  3. I'm new in programming field. I uploaded a form of html page, i have created two input field:- upload profile and signature which i 'm trying to insert these two field in different folders eg: profile in Uploads/profile/ and signature in Uploads/sign/. But its save only one field image not both. And also i have no idea how to save these two images with name of id(unique name) and Doctor name (input text field). For eg: in database doctor name: Amit, id: 31; so im trying to save image name is Amit31. please help me out. here is my php code: <?php require 'config.php'; if(isset($_POST['submit'])){ $file1 = $_FILES['doc_profile']['name']; $file_tmp1 = $_FILES['doc_profile']['tmp_name']; $pro = "Upload/Profile/" . $file1; $file2 = $_FILES['sign']['name']; $file_tmp2 = $_FILES['sign']['tmp_name']; $signature = "Upload/sign/" . $file2; $data= []; $data= [$file1,$file2]; $images= implode(' ',$data); $Name = $_POST['Name']; $gender = $_POST['gender']; $phone = $_POST['phone']; $location = $_POST['location']; $Qualification = $_POST['Qualification']; $Speciality = $_POST['Speciality']; $Experience = $_POST['Experience']; $License_No = $_POST['License_No']; $Email = $_POST['Email']; $Password = $_POST['Password']; //$Image = $_POST['Image']; //$Signature = $_POST['Signature']; header("Location: sign.html"); $sql = ("INSERT INTO doctor (Doctor_Name, gender, Phone, Location, Qualification, Speciality, Experience, License_No, Email, Password) value('$Name', '$gender', '$phone', '$location', '$Qualification', '$Speciality', '$Experience', '$License_No', '$Email', '$Password')"); $insertquery= mysqli_query($con, $sql); if($insertquery){ move_uploaded_file($file_tmp1, $pro); move_uploaded_file($file_tmp2, $signature); echo "success"; } else{ echo "ERROR: $sql <br> $con->error"; } $con->close(); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.