Changeset 2172
- Timestamp:
- 08/28/2007 10:15:30 PM (15 months ago)
- Location:
- trunk/demos/helloworld/protected/pages
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/demos/helloworld/protected/pages/Home.page
r2171 r2172 8 8 9 9 <com:TForm> 10 <com:TCaptcha ID="Captcha" CaseSensitive="true" MaxTokenLength="5" />11 <com:TTextBox ID="Input" />12 10 <com:TButton Text="Click me" OnClick="buttonClicked" /> 13 <com:TCaptchaValidator EnableClientScript="true" ControlToValidate="Input" CaptchaControl="Captcha" Text="invalid" />14 11 </com:TForm> 15 12 -
trunk/demos/helloworld/protected/pages/Home.php
r2171 r2172 3 3 class Home extends TPage 4 4 { 5 public function onPreRender($param)6 {7 echo "token is |".$this->Captcha->Token."|";8 }9 10 5 public function buttonClicked($sender,$param) 11 6 { 12 if($this->Captcha->validate($this->Input->Text)) 13 $sender->Text="ok"; 14 else 15 $sender->Text="no!"; 16 $this->Captcha->regenerateToken(); 7 $sender->Text='Hello world!'; 17 8 } 18 9 }
