目前php:
<?php
session_start();
if(isset($_SESSION['list'])==false){
$_SESSION['list']=[];
}
$queryString = $_SERVER['QUERY_STRING'];
parse_str($queryString, $queryParams);
if(($queryParams->sta)=='add'){
$str=$queryParams->wd;
array_push($_SESSION['list'], $str);
}
?>
<!DOCTYPE html>
<html>
<pre>
<?php
$see=($queryParams->sta);
echo(implode("\n", $_SESSION['list']));
?>
</pre>
<input placeholder='Input Message' id='1'/>
<button onclick='s()'>Send</button>
<script>
function s(){
var a=document.createElement("a");
a.href=location.href.split("?")[0]+'?sta=add&wd='+document.getElementById('1').value;
a.click();
}
</script>
</html>
要保存session数据的$_SESSION[“list”]到数据库并连接
(如果是sql数据库,谁能帮我把sql放到一个专门的网址上,我的设备不支持sql和ini)