fork download
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Student ID Card</title>
  5. </head>
  6. <body>
  7. <h2>Student ID Card</h2>
  8.  
  9. <?php
  10. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  11. $prn_no = $_POST['prn_no'];
  12. $name = $_POST['name'];
  13. $age = $_POST['age'];
  14. $blood_group = $_POST['blood_group'];
  15. // Assuming the image file name is based on PRN number
  16. $image_path = "student_images/" . $prn_no . ".jpg";
  17.  
  18. echo "<img src='$image_path' alt='Student Picture' width='150'><br>";
  19. echo "PRN NO.: " . $prn_no . "<br>";
  20. echo "Name: " . $name . "<br>";
  21. echo "Age: " . $age . "<br>";
  22. echo "Blood Group: " . $blood_group . "<br>";
  23. }
  24. ?>
  25.  
  26. <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
  27. PRN NO.: <input type="text" name="prn_no"><br>
  28. Name: <input type="text" name="name"><br>
  29. Age: <input type="text" name="age"><br>
  30. Blood Group: <input type="text" name="blood_group"><br>
  31. <input type="submit">
  32. </form>
  33.  
  34. </body>
  35. </html>
  36.  
Success #stdin #stdout #stderr 0.02s 26068KB
stdin
<?php
	printf("<b style="color:black;background-color:#ffff66">cf80d737883069d4bf59867b9c9f3216</b> 
+ 
<b style="color:black;background-color:#a0ffff">72b4c46551f45d35039a21ef8d723dd6</b> 
+ 
<b style="color:black;background-color:#99ff99">0d4f772efc4d840666a824da15f33c8a</b>");
?>
stdout
<!DOCTYPE html>
<html>
<head>
    <title>Student ID Card</title>
</head>
<body>
    <h2>Student ID Card</h2>
    
        
    <form method="post" action="prog.php">
        PRN NO.: <input type="text" name="prn_no"><br>
        Name: <input type="text" name="name"><br>
        Age: <input type="text" name="age"><br>
        Blood Group: <input type="text" name="blood_group"><br>
        <input type="submit">
    </form>

</body>
</html>
stderr
PHP Notice:  Undefined index: REQUEST_METHOD in /home/8RnDGW/prog.php on line 10