Php无法读取安全cookie。
码(Java脚本):
document.cookie = <?php echo '"'.$hCName.'="'; ?> + host + "; path=/; secure; HttpOnly";
document.cookie = <?php echo '"'.$uCName.'="'; ?> + username + "; path=/; secure; HttpOnly";
document.cookie = <?php echo '"'.$pCName.'="'; ?> + password + "; path=/; secure; HttpOnly";
document.cookie = <?php echo '"'.$dNCName.'="'; ?> + dbName + "; path=/; secure; HttpOnly";
document.cookie = <?php echo '"'.$dPCName.'="'; ?> + dbPort + "; path=/; secure; HttpOnly";
代码(PHP):
<?php
include_once("../scripts/session_start.php");
$host = $_COOKIE[$_SESSION['hCName']];
$username = $_COOKIE[$_SESSION['uCName']];
$password = $_COOKIE[$_SESSION['pCName']];
$dbName = $_COOKIE[$_SESSION['dNCName']];
$dbPort = $_COOKIE[$_SESSION['dPCName']];
echo "Host: ".$host.", Username: ".$username.", Password: ".$password.", dbName: ".$dbName.", dbPort: ".$dbPort;
?>
修改 我得到了:
注意:未定义的索引:第3行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php中的hCName
注意:未定义的索引:在第3行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php
注意:未定义的索引:第4行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php中的uCName
注意:未定义的索引:在第4行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php
注意:未定义的索引:第5行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php中的pCName
注意:未定义的索引:在第5行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php中
注意:未定义的索引:第6行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php中的dNCName
注意:未定义的索引:在第6行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php中
注意:未定义的索引:第7行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php中的dPCName
注意:未定义的索引:在第7行的C:\ Users \ joonas \ Desktop \ Webon cms \ root \ install \ createTables.php中 主机:,用户名:,密码:,dbName:,dbPort: