Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

"Notice: Use of undefined constant login - assumed"

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Polish
View previous topic :: View next topic  
Author Message
ViX
Smarty n00b


Joined: 27 Dec 2008
Posts: 3

PostPosted: Sat Dec 27, 2008 7:40 pm    Post subject: "Notice: Use of undefined constant login - assumed" Reply with quote

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
View user's profile Send private message
fornve
Smarty Rookie


Joined: 25 Apr 2008
Posts: 29
Location: Sheffield, UK

PostPosted: Tue Dec 30, 2008 8:38 pm    Post subject: Reply with quote

To jest tylko 'notice', kod dziala prawidłowo przy tym.

Spróbuj dodać apostrofy

if(!empty($_POST['login']) && !empty($_POST['haslo'])){
...
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Polish All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP