HOME | DD
Published: 2008-12-13 15:41:40 +0000 UTC; Views: 965; Favourites: 0; Downloads: 28
Redirect to original
Description
Finished the design for the password protection form for simplecandy. This is awesome in Textpattern, basically works like if and else statements in PHP, but using XML, basically test if user is logged in, or else display the form.I prefer this method far better than having it redirect to a login form, I mean why have a dedicated login page? When you can just dynamically generate one within the page your trying to access, much more professional in my eyes!
Related content
Comments: 4
neko-xexe [2008-12-14 00:28:21 +0000 UTC]
Dynamically generated? Like coded into the page you're password protecting?
👍: 0 ⏩: 1
simplecandy In reply to neko-xexe [2008-12-14 00:57:53 +0000 UTC]
Yes and No, basically I have a page (which is the name of templates in Textpattern) and within this page I have some tags that test whether your logged in or not. If your logged in you see the page, if not then Txp imports my password form, which is another template, but this time a Txp:form (blocks of code in Textpattern).
So the whole section is dynamically generated using a variety of code, but unlike doing it with raw php which would have lots of .php files, it is all in the database, making it 10 times more efficient, no one can stumble upon any of the files because they dont exist, they only exist on database in code blocks. Hence why I like Txp
👍: 0 ⏩: 1
neko-xexe In reply to simplecandy [2008-12-14 02:18:58 +0000 UTC]
Okay, I'm not too familiar with Textpattern but I understand what you said.
Not too sure having the database holding things like that is really efficient but we could argue about efficiency for a good long time, but that wouldn't be efficient at all.
It's an interesting idea, I've heard of doing similar things such as storing sessions in databases for security and such. I'd like to know how it gets on, how it handles under multiple requests when you get high traffic.
It's easy to edit right? And with a few lines it's down on the page?
👍: 0 ⏩: 1
simplecandy In reply to neko-xexe [2008-12-14 18:26:52 +0000 UTC]
I prefer the database method, mainly because its easy to edit online, easy to backup in one XML file, rather than loads of separate files and its much more dynamic.
As for the editing, this is a sample:
my html pageutput_form form="password_protect" />
Its really that simple, and those are actually the same tags used! So about 4 lines, excluding you actual page content. x
👍: 0 ⏩: 0





















