Sample PHP Script

The PHP script below can be used to generate QR codes for starting a photo booth session and automatically sending an email. This script comes with no warranty whatsoever and if you choose to use it you do so entirely at your own risk.

<!DOCTYPE html>
<html lang="en">
  <title>Breeze Booth QR Code Generator</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Breeze Systems - Photo Booth QR Code Generator">
  <meta name="author" content="Breeze Systems Ltd">
  <link rel="stylesheet" href="" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
  <script src="" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
  <div class="container">

// read POST parameters
$email = $_POST["email"];
$cc = $_POST["cc"];
$session = $_POST["session"];
$script = $_SERVER["SCRIPT_NAME"];

if (strlen($email) > 3) {
  // display QR code
  $info = 'Email address: ' . $email;
  $email = '&autoemail=' . urlencode($email);
  $info .= '<br>Session type: ' . $session;
  if ($session == "photo") {
    $cmd = 'c1=' . urlencode('Select photobooth+start') . '&c2=' . urlencode('switchToStillsAndStart');
  } else {
    $cmd = 'c1=' . urlencode('Select video booth+start') . '&c2=' .urlencode('switchToGifAndStart');
  $url = urlencode("$script?$cmd$email");

  echo <<<QR
  <img class="img-responsive" src="$url&choe=UTF-8" title="Photo Booth QR Code">
  <a href="$script" class="btn btn-info" role="button">Enter new email address</a>
} else {
  // display form asking for email address and session type
  echo <<<FORM
<h3>Photo Booth QR Code Generator</h3>
<form action="$script" method="post">
  <div class="form-group">
    <label for="email">Email address:</label>
    <input type="email" class="form-control" placeholder="Enter email" id="email" name="email" required pattern="^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$">
  <div class="form-check">
    <label class="form-check-label">
      <input type="radio" class="form-check-input" name="session" value="photo" checked>Photos
  <div class="form-check">
    <label class="form-check-label">
      <input type="radio" class="form-check-input" name="session" value="gif">Boomerang GIF
  <button type="submit" class="btn btn-primary">Generate QR code</button>
  <hr class="featurette-divider">
    <p>&copy; 2020 Copyright information goes here</p>
Run script