submit (1084B)
1 #!/bin/sh 2 printf 'Content-Type: text/html; charset=utf-8\r\n\r\n' 3 4 id=${PATH_INFO##*/} 5 6 cat <<EOF 7 <!DOCTYPE html> 8 <html> 9 <head> 10 <meta charset="utf-8"> 11 <title>Submit code: $id</title> 12 </head> 13 <body> 14 <h1>ojudge, submit code</h1> 15 <p>Problem: <a href="/cgi-bin/problems/$id">$id</a></p> 16 <div class="form-container"> 17 <form id="submit-code" action="/cgi-bin/submit-code/$id" method="post"> 18 <label for="username">Username</label><br> 19 <input id="username" name="username" required><br> 20 21 <label for="language">Language</label><br> 22 <select name="language" id="language"> 23 <option value="ocaml">OCaml</option> 24 <option value="c">C</option> 25 <option value="cpp">C++</option> 26 </select><br> 27 28 <label for="code">Code</label><br> 29 <textarea id="code" name="code" rows="20" cols="80" 30 spellcheck="false" required></textarea><br> 31 <input type="submit" value="Submit"> 32 </form> 33 </div> 34 </body> 35 </html> 36 EOF