mTzen
Новичок
проблема с классами
Помогите, не могу понять почему не работает "class Settings".
index.php
settings.php
Объясните мне причину, почему класс settings ничего не выводит ?
Помогите, не могу понять почему не работает "class Settings".
index.php
PHP:
<?php
require('core.php');
class Index extends Core{
function Index()
{
Core::Core();
if(isset($_GET['act']))
{
if($_GET['act'] == "login" && $_POST['login'] == ADMIN && $_POST['password'] == PASS)
{
setcookie("cookieshop_cookie", "cookie");
$this->redirect('admin/index.php');
}
}
}
}
$obj = new Index();
?>
<html>
<body>
<? if(isset($_REQUEST['pg'])): ?>
<? if($_REQUEST['pg'] == "settings"): ?>
<? include("settings.php"); ?>
<? endif; ?>
<? endif; ?>
</body>
</html>
PHP:
<?php
class Settings extends Core{
function Settings()
{
if(isset($_GET['do']))
{
switch ($_GET['do'])
{
case 'edit':
echo $_POST['word'];
break;
}
}
}
}
?>
<html>
<body>
<form action="index.php?pg=settings&do=edit" method="POST">
<input type="text" name="word"/>
<input type="submit" value="enter".>
</form>
</body>
</html>
