Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About aguskianto

  • Rank
  1. Hi everyone! I am trying to create a clean URL for yii_cms application. I install xampp (c:/xampp) and I delete # sign in httpd.conf (this line: LoadModule rewrite_module modules/mod_rewrite.so). Then, I create .htaccess in C:/xampp/htdocs/yii_cms folder. .htaccess file contains these lines: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA] </IfModule> Then..., I edit main.php at C:/xampp/htdocs/yii-cms/protected/config/main.php and add two lines in bold format: 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false, 'caseSensitive'=>false, 'rules'=>array( '<controller:\w+>/<id:\d+>'=>'<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', ), ), I restarted apache service through xampp control and I get this error while accessing the page (http://localhost/yii...page?view=about) <= local server Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error. If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16 What is wrong with my page if I access with no index.php? If I access them using index.php, everything is OK. Please, help me with these errors.
  2. Well, I do understand that you create that user table. But, can I use that already in this chapter? Or, should I wait for later chapter for this things to work? One thing for sure, I try to login using those user in the user table but I got some: "Incorrect username or password" error. So, once again I ask: can this user in the table be used in this chapter already? or should I wait for another chapter.
  3. I think I found something interesting. I don't find Username Admin Password Admin on my User table. This username is used to accress create page. But this username is not listed on the table: 1 Test 2 Someones 3 Some Author 4 Another Author 5 Administrator 6 Another Admin 7 Jane 8 John 9 Curly 10 Moe 11 Larry 12 Vlad 13 testing 14 Latest Test 15 Joe Public 16 Jane Public Is there any connection between those two?
  4. Dear All, I've been following the book until I reach Chapter 5 Page 101: # protected/models/Page.phpprotected function beforeValidate(){ if(empty($this->user_id)) { $this->user_id = Yii::app()->user->id; } return parent::beforeValidate();} The problem that I found when I try to create Page: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'user_id' at row 1. The SQL statement executed was: INSERT INTO `page` (`live`, `user_id`, `title`, `content`, `date_updated`, `date_published`) VALUES (:yp0, :yp1, :yp2, :yp3, NOW(), :yp4) Is there something that I miss? Regards, Agus Kianto
  5. Dear all, What does "/i" means in this statement: array('pass', 'match', 'pattern'=>'/^[a-z0-9_-]{6,20}$/i') There is no error, just don't know what "/i" does. Thanks before.
  6. ah..., yes. It works. Thank you so much Daniele.
  7. Is there a way to attach image to this thread? It'll clearer that way.
  8. Dear all, I follow the yii book until chapter 5. I got no problem until I reach page 94 and I add this code: # protected/models/Page.php::rules() array('date_published', 'date', 'format'=>'YYYY-MM-DD'), I got error while opening create Page: Please fix the following input errors: The format of Date Published is invalid. When I type 2013-04-05. Is there something wrong?
  • Create New...