submit.sh (1139B)
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 <option value="python">Python</option> 27 </select><br> 28 29 <label for="code">Code</label><br> 30 <textarea id="code" name="code" rows="20" cols="80" 31 spellcheck="false" required></textarea><br> 32 <input type="submit" value="Submit"> 33 </form> 34 </div> 35 </body> 36 </html> 37 EOF