JSFiddle - React, Tailwind, and code Playground
by hongyang1033
HTML
<?php
session_start();
require 'mysql_config.php';
if (!isset($_SESSION['username'])) {
header('Location: http://'.$ip.'/work/web/login.php');
}
$con = new mysqli(DB_HOST, DB_USER, DB_PASS, $project);
$query = 'INSERT IGNORE INTO `submission` (id, par, sip, def, unixpath, sambapath,emulation,simulation,synthesis,comment,user,reviewer) VALUES ("'.$_SESSION['username'].'", "'.$_POST['partition'].'", "'.$_POST['sip'].'", "'.$_POST['define'].'", "'.$_POST['unixpath'].'","'.$_POST['sambapath'].'","'.$_POST['emulation'].'","'.$_POST['simulation'].'","'.$_POST['synthesis'].'","'.$_POST['comment'].'","'.$_POST['user'].'","'.$_POST['reviewer'].'")';
mysqli_query($con, $query) or die(mysqli_error($con));
?>
JavaScript
<?php
session_start();
require 'mysql_config.php';
if (!isset($_SESSION['username'])) {
header('Location: http://'.$ip.'/work/web/login.php');
}
$con = new mysqli(DB_HOST, DB_USER, DB_PASS, $project);
foreach ($_POST['prefs'] as $pref) {
list($par, $sip, $def, $pathl,$sambapath) = explode(',', $pref);
$query = 'INSERT IGNORE INTO `temp` (user, step, model, par, sip, def,pathl,sambapath) VALUES ("'.$_SESSION['username'].'", "'.$_SESSION['step'].'", "'.$_SESSION['model'].'", "'.$par.'", "'.$sip.'", "'.$def.'","'.$pathl.'","'.$sambapath.'")';
mysqli_query($con, $query) or die(mysqli_error($con));
}
?>