Yet another PHP based Funko Pop collection tracker, about as bare bones as you can get, but it's functional.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

34 lignes
1.5 KiB

  1. <?php
  2. $pagetitle = "Add Collection";
  3. include_once ('header.php');
  4. if (isset($userid)){
  5. echo '<BODY onLoad="document.fpcform.collection.focus()">';
  6. $fpcname = (isset($_POST['collection']) ? $_POST['collection'] : null);
  7. $fpcname = mysqli_real_escape_string($con, $fpcname);
  8. $sqlfpcname = "INSERT INTO funkopops.popcollection (popcollection) VALUES ('$fpcname')";
  9. if (!empty($fpcname)) {
  10. if (!$result = $con->query($sqlfpcname)){
  11. die ('There was an error running the query [' . $con->error . ']');
  12. }
  13. echo 'You have successfully entered ' . $fpcname . ' into the database!<BR />';
  14. echo 'Refreshing page in 2 seconds to add another pop collection group.<BR />';
  15. header("refresh:2;url=collection.php");
  16. } else {
  17. echo '<TABLE BORDER="0">';
  18. echo '<FORM METHOD="POST" ACTION="collection.php" NAME="fpcform"><TR><TD>Collection Name: <INPUT TYPE="TEXT" NAME="collection" SIZE="25"></TD></TR>';
  19. echo '<TR><TD><CENTER><INPUT TYPE="SUBMIT" VALUE="Add Group to Database"></CENTER></FORM></TD></TR></TABLE>';
  20. echo '<BR />';
  21. echo 'Here\'s the existing groups: <SELECT>';
  22. $sqlgrouplist = "SELECT * FROM funkopops.popcollection ORDER BY popcollection ASC";
  23. if (!$result = $con->query($sqlgrouplist)){
  24. die ('There was an error running the query [' . $con->error . ']');
  25. }
  26. while ($row = $result->fetch_array()){
  27. $groupname = $row['popcollection'];
  28. echo '<OPTION VALUE="' . $groupname . '">' . $groupname . '</OPTION>';
  29. }
  30. echo '</SELECT><BR /><BR /> ';
  31. }
  32. }
  33. include_once ('footer.php');
  34. ?>