Ahoj,
pokouším se vytvořit Caesarovu šifru, ale nějak mi to habruje... Když chci zavolat funkci Output, tak mi to vypisuje na řádku echo $caesar->Output(); tuto chybu: Fatal error: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Caesar" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in C:\xampp\htdocs\sifra\sifraa.php on line 36
Nevíte co s tím? :O
<?php
include './knihovna.php';
session_start();
if (!isset( $_SESSION['main'] ))
{
$_SESSION['main'] = serialize( new Sifra() );
}
$caesar = unserialize( $_SESSION['main'] );
if (!empty( $_POST['inputWord'] ))
{
$caesar->Code( $_POST['inputWord'] );
$_SESSION['main'] = serialize( $caesar );
unset($_POST);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<form method="post" action="sifraa.php">
<p>
Zadejte slovo: <input type="text" name="inputWord" />
<input type="submit" name="Odeslat" />
</p>
</form>
<?php
echo $caesar->Output();
?>
</body>
</html>