|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ViX Smarty n00b
Joined: 27 Dec 2008 Posts: 3
|
Posted: Sat Dec 27, 2008 7:40 pm Post subject: "Notice: Use of undefined constant login - assumed" |
|
|
Drodzy koledzy po fachu pomóżcie. Mam taki kodzik w pliku index.php
<?php
session_start();
require_once('../libs/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = '../templates/admin';
$smarty->compile_dir = '../templates_c';
$smarty->cache_dir = '../cache';
$smarty->config_dir = '../configs';
$error = '';
if(!empty($_POST[login]) && !empty($_POST[haslo])){ <= z błędu wynika że tutaj jest błąd
if($_POST[login] == 'xxx' && $_POST[haslo] == 'xxx') {
$_SESSION[login] = 'xxx';
} else {
$error = 'Zły login lub hasło';
}
}
$smarty->assign('error', $error);
$smarty->display('admin_index.tpl');
?>
i wywala mi takie info:
Notice: Use of undefined constant login - assumed 'login' in /home/organizacje/uks/public_html/admin/index.php on line 11
Co mogę z tym zrobić? |
|
Back to top |
|
fornve Smarty Rookie
Joined: 25 Apr 2008 Posts: 29 Location: Sheffield, UK
|
Posted: Tue Dec 30, 2008 8:38 pm Post subject: |
|
|
To jest tylko 'notice', kod dziala prawidłowo przy tym.
Spróbuj dodać apostrofy
if(!empty($_POST['login']) && !empty($_POST['haslo'])){
... |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|