Posted by Cas on 10/06/93 11:14
Because I'm not sure if attachments are included in this mailinglist,
I copied the source of my sample script:
----- start file ------
<?
session_start();
if (!$_POST)
{
// Make new DOMDocument
$dom = new DOMDocument('1.0', 'utf-8');
$dom->loadXML('<root><node>The almighty DOM</node></root>');
// Write DOMDocument to session
$_SESSION['dom'] = $dom;
// Trying a variable too
$_SESSION['var'] = 'foo';
//check if we could fetch the DOM out of the session before the form send.
print $_SESSION['dom']->saveXML();
}
else
{
// Read DOMDocument out of session after send, this doesn't work
print $_SESSION['dom']->saveXML();
// Read the variable out to prove the session is ok
print $_SESSION['var'];
}
?>
<!DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PHP sample file</title>
</head>
<body>
<form name="login" action="index.php" method="post">
<input type="hidden" name="aaa"><input type="submit" value="Submit">
</form>
</body>
</html>
----- end of file ------
Navigation:
[Reply to this message]
|