Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [SMARTY] redirection
You can make Form itself and POST validation by one script

For example, login.php
=================
<?php
if($_POST) {
$error = '';
// form validation
..

// if there's no error...
if(empty($error)) {
header("Location: loged.php");
exit;
} else {
$smarty->assign('error', $error);
}
}

$smarty->display('login_form.tpl')
?>
=================


login_form.tpl
=================
{* Login form *}

{if $error}<b class=error>{$error}</b>{/if}

<form action="{$smarty.server.PHP_SELF}" method="post">
....
</form>
=================

;)


EB> I have a basic question about redirection, and assigning values.

EB> In a nutshell, I want my login procedure to redirect back to the login p
age
EB> if there was an error, but I also want to assign a message to the form.
EB> Obviously, the message assignment gets wiped out.

EB> How do I deal with?


EB> Best regards,

EB> Erich Beyrent
EB> Systems Administrator
EB> Information Technology Services
EB> Plymouth State University
EB> (603) 535-2948
EB> ecbeyrent@plymouth.edu

EB> "Si vis pacem para bellum"

Report this thread to moderator Post Follow-up to this message
Old Post
On.Kg
12-02-04 09:08 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:30 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.