For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > December 2004 > RE: [SMARTY] redirection









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [SMARTY] redirection
Geoffrey Hoffman

2004-12-02, 4:08 pm


In PHP:

if( yourLoginTestHere ){
$smarty->assign("status", "");
}else{
$smarty->assign("status", "Your login failed.");
}

In login form tpl:

{status}


It can be tricky, because the 1st time they use the login page, they haven't
tried to login yet - so your login test has to check to see if they actually
tried to login or if this is the first view of the page.

Also, there may be a cacheing issue, for the first time they see the form,
status probably = "" then only if they see the page a 2nd time, it gets the
status of "Your login failed.", so try not cacheing the page if it doesn't
work right away.

HTH-


-----Original Message-----
From: Erich Beyrent [mailto:erich.beyrent@beyrent.net]
Sent: Thursday, December 02, 2004 11:29 AM
To: smarty-general@lists.php.net
Subject: [SMARTY] redirection

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

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

How do I deal with?


Best regards,

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

"Si vis pacem para bellum"

--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com