|
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 |
thiebo Smarty Pro
Joined: 16 Jan 2005 Posts: 144 Location: Paris
|
Posted: Fri Jan 28, 2005 8:53 pm Post subject: SmartyValidate error messages |
|
|
Hello,
I've just installed SmartyValidate and tried to test it with the index.php, form.tpl and success.tpl provided in the README, but I get some strange messages :
Quote: | [client 127.0.0.1] PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/smartysite/index.php:1) in /var/www/html/smartysite/index.php on line 2
[client 127.0.0.1] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/smartysite/index.php:1) in /var/www/html/smartysite/index.php on line 2
|
I do not know what to do with these messages since in index.php, function session_start(); is callled immediately after <?php.
[php:1:f926a10c66]<?php
session_start();
// you will need to setup Smarty if
// the defaults are not correct.
require ('/usr/local/lib/php/Includes/smartysite/setup.php');
require('SmartyValidate.class.php');
$smarty = &new Smarty_smartysite;
// required initialization
SmartyValidate::connect($smarty);
if(empty($_POST)) {
$smarty->display('/var/www/html/smarty/templates/form.tpl');
} else {
// validate after a POST
if(SmartyValidate::is_valid($_POST)) {
// no errors, done with SmartyValidate
SmartyValidate::disconnect();
$smarty->display('success.tpl');
} else {
// error, redraw the form
$smarty->assign($_POST);
$smarty->display('form.tpl');
}
}
?>
?>[/php:1:f926a10c66]
The plugins are all copied into plugin directory : e.g. : /usr/local/lib/Smarty/plugins/block.textformat.php
I my webbrowser, I get the form, but it does not react at all (seems logic after that type of error messages)
Does anybody see what I did wrong ???
Thanks,
Thiebo |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Jan 28, 2005 8:57 pm Post subject: |
|
|
You must have a space or something before the <?php tag. |
|
Back to top |
|
thiebo Smarty Pro
Joined: 16 Jan 2005 Posts: 144 Location: Paris
|
Posted: Fri Jan 28, 2005 9:54 pm Post subject: |
|
|
Hi Mohrt,
That was exactly the problem ! It works fine now.
Many thanks,
Thiebo |
|
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
|