[TYPO3] password protect a single page?
Bing Du
bdu at iastate.edu
Fri Feb 2 21:17:25 CET 2007
> mmmm what about this
>
> On a higher up page a form that asks for a code, that you then send to a
> page as part of a get or post (say entrycode=XXX). just a hand coded
> simple html form.
>
> Then create atemplate on teh protected page, and in it some conditional
> [globalVar = GP:entrycode = 627] that lets them see the page.
>
> If they don't have the right code, and therefore the right get string
> the template invokes
>
> [globalVar = GP:entrycode = 627]
>
> [else]
> config.additionalHeaders = Location:
> http://default.netefficiency.co.uk/index.php?id=1
> [global]
>
> would that work for you?
That's an interesting idea. Thanks much. I have some questions.
I created a new page 'form' for the 'protected page' in the page tree: (do
they have to be on different levels?)
form
protected page
The 'form' page is a PHP script like this
==
<?php
global $entrycode;
$entrycode = $_POST['entrycode'];
?>
<form action='http://typo3.some.edu/form/protected-page' method='POST'>
Enter the code: <input type='text' name='entrycode'>
<input type='submit' value='Submit'>
</form>
==
Is that the right way to pass 'entrycode' to the 'protected page'?
Where should I put [globalVar = GP:entrycode = sometextcode], etc., page
TSconfig or template setup of the protected page? I put that in the ext
template setup of the 'protected page'. But after I entered code and
clicked the 'submit' button on the form page, it jumped to the protected
page and showed its contents regardless of what entrycode I entered.
Seemed like the condition 'globalVar' was not checked at all.
Thanks,
Bing
More information about the TYPO3-english
mailing list