html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!--
Created by Erin
* Edited for a question:
https://www.sololearn.com/Discuss/2349814/?ref=app
* Original code:
https://code.sololearn.com/W0400zO7jtE0/?ref=app
-->
<!--
<?php
session_start();
include("connection.php");
if(isset($_POST['submit']))
{
$description=$_POST['value'];
$chk = "";
foreach ($description as $chk1)
{
$chk .= $chk1;
}
$sql = "insert into problem(P_ID, description) values('','$chk')";
if($con->query($sql) === true)
{
echo "success";
echo "<meta http-equiv = 'refresh' content ='0; url = problemForm.php'/>";
}
else
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Created by Erin */
body
{
background-color:teal;
}
img
{
border: 2px solid #ddd;
border-radius: 20px;
margin-bottom: 1em;
}
label
{
display: block;
}
input[type=submit], input[type=reset]
{
margin: 1em;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by Erin
onload = function()
{
// form submission handler
document.forms["problem-form"].onsubmit = function()
{
let text = {length : 0};
for(checkbox of checkboxes)
{
if(checkbox.checked)
{
text.length++;
let key = checkbox.name.replace("[]", "");
let record = text[key];
if(record === undefined)
{
text[key]= `'${checkbox.value}'`;
}
else
{
text[key] += `, '${checkbox.value}'`;
}
}
}
if(text.length)
{
for(el in text)
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run