Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Edward

  1. I don't know what it was because i changed servers and it never happened on the next one. It seems the PHP script generator was timing out half way down an page for some reason. No idea but the case will have to be closed.
  2. I set them to 766 and now receive this error PHP warning mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied I will leave this at 777 for now until i figure out a solution. I have been working on other stuff now like removing the responsiveness from Bootstrap 3. My website is really too big for me alone without working on independent mobile layouts so i just do standard for now. Also i found that if i ever go to eBay or other mobile apps i find them to be crappy and just leave me switching over to the normal site view anyway. I think the responsive crap seems to be a waste of time for sites like Amazon and eBay they don't even work properly or show all the product listings. But if you were using this on the other hand with blogs sites and so i think it would be useful. Sorry for talking a lot I just releasing some of my development pressure.
  3. I tried to set mine back to 755 that all my other folders on the server are configured to but got this error again. CException Application runtime path "/home/edward/public_html/protected/runtime" is not valid. Please make sure it is a directory writable by the Web server process.
  4. Thank you very much Larry Ullman "I love you!" Everything is now working as it should, thanks for your amazing help and knowledge. I hope one day i can show you my achievement.
  5. Okay i am going through problem after problem right now trying to get things running on a server. May be Larry will have a conslusive answer for this problem. It's sad but i may have to end up purchasing the Dummy's Guide to Servers. Or Larry, "Can you right a Geek to English book on servers?" Just kidding...hehe!!
  6. You shouldn't have direct many to many relationships in your code assuming you have, you first need to make an intermediary table to get one to many relationships then use the use many to many relationship configuration in relations() method in your Yii model(). Then use the relationship in the CGridView and it should work fine. Reference http://www.yiiframework.com/doc/guide/1.1/en/database.arr class Post extends CActiveRecord { ...... public function relations() { return array( 'author'=>array(self::BELONGS_TO, 'User', 'author_id'), 'categories'=>array(self::MANY_MANY, 'Category', 'tbl_post_category(post_id, category_id)'), ); } }
  7. Thanks Jonathon, this is a useful thread and checklist for me to go through. Can i ask what did you set the permissions to on your server for the two folders. The strange thing is i didn't get problem on another server when i uploaded the files but on the new server i am getting an error message showing up, so i had to set it to 777 for the Yii app to run. Seriously i know nothing about servers and this kind of IT technician stuff, i am an Airhead when it comes to this sort of stuff.
  8. I wanted to ask what should the files permissions be for both the Assets and Runtime folder? I have set both of mine to 777 which allows the Yii Application to run. But is this correct? I am working with a new vps server and getting new errors so i may as a few different questions this week.
  9. Yeah it may take another year and a half to finish, there is still a ton of work to be done on it. I saw one website similar to that was up and 5 times worse without the care and details i have and there were 14 people working on it. I am starting to believe that i may be a super genius working on mine alone. If i was in that other company i would of kicked their asses for making such a mess like that. It could be that already know what you will publish in the ecommerce chapter but i am certainly eager to find out.
  10. $rawData=Yii::app()->db->createCommand('SELECT * FROM tbl_user')->queryAll(); // or using: $rawData=User::model()->findAll(); $dataProvider=new CArrayDataProvider($rawData, array( 'id'=>'user', 'sort'=>array( 'attributes'=>array( 'id', 'username', 'email', ), ), 'pagination'=>array( 'pageSize'=>10, ), )); // $dataProvider->getData() will return a list of arrays. With CActiveDataProvider queryAll() or findAll() you insert in for your $rawData, so i am guess the problems is happening in your views files from trying to interpret the returned data from the CActiveDataProvider. Can you show us more of the _view.php code and possibly do a print_r surrounded by some HTML <pre> (preformatted tags) of the data attribute $dataProvider you are passing to the _view.php file and post it up here. <pre> <?php print_r($dataProvider); ?> </pre
  11. Larry how are you doing? I was wondering when will the ecommerce chapter be coming out, i am starting to recode some parts of my website and would really love to see some of your examples before i go possibly down the wrong tracks. I don't know about you or other guys around here but sometimes i get really bored looking at the same code every day, i took about a week and a half off and now have just started back up. I will be changing some of my main site pages to work with ajax only and obviously run PHP server validation for a final confirmation. But unfortanetly with the complexity of the page i need to work on the Yii Ajax Validation will quite frankly not cut it, so i will need to write all the code myself. The good thing is that i can use the server model validations for the specific data which will save some time. There is progressive enhance but for complex sites like eBay just forget about using it if you don't have Javascript because it won't work. Well it doesn't for me when i have JavaScript disabled or if it does for you may be you have some super computer computer that doesn't need it.
  12. No problem, sorry i can't help out as much here as before.
  13. I added some yii extensions in the beginning like YiiBooster but later decided to pull it out later, the problem is they are only maintained for so long then you are left to handle it for yourself. I think using extensions also depends on the size of your project, if you are building something small then using them is okay but if you are building something large which will need continually updated i think using your own code is better. I try to write my own code for everything i really hate to use extensions i like to know how things are working exactly and don't like to depend on others unless of course they have a lot of reputation and people to backup like using the Yii Framework does. It would be impossible for one to write a framework plus develop a large scale site both of these are separate issues. If you are looking to use others extensions you need to make sure they are actively maintained and updated i think that is the most important issue in regards to them.
  14. I believe i know the solution, i always find when i listen to Larry Ullman and take his actions the results are always positive. I would love to tell you what im going to do but unfornately i can't, it will just have to be left as a mystery........
  15. The thing is, the website works on mobile devices but doesn't work on desktop devices, that's the strange thing about it. I believe this is some kind of hosting problem as i have had hosting before from another company and never had weird stuff like this happening. Ive just done some research into the database and connection but it appears i am doing that correct. Let me call the host and get some help. Thanks for your advice. By the way i didn't ever think it was a Yii issue but it worries me as i have more than 100 scripts to go through and test, so i could be up for more than a handful of errors to fix online. And how long is that going to take?
  16. i just put up my yii website on a live server, and i found the results to be quite worrying. The form pages sometimes only half load on mozilla or chrome and sometimes don't load at all. The yii verfication image like google's captcha only half loads on the desktop but fully loads on a mobile device, sometimes i may just show the default browser image icon. I had chrome crash with the yii site on the user registration page, strange results, i didn't experience anything like this on my localhost. But strangely ajax functions are working 100%. On my user/create page the browser show that it failed to GET the page after a page redirect? Looked at this problem for a few hours now, i have no idea what's causing that.
  17. If there is bit of javascript syntax wrong the whole thing won't work, i see a missing single quotation mark missing at this point document.getElementById('output').innerHTML = 'Error: + ajax.statusText; so it should be document.getElementById('output').innerHTML = 'Error:' + ajax.statusText;
  18. Yeah but we are using Yii 1, that's the problem here. What are you going to do write the custom code for disabling some controller/action routes or are you just going to leave things the way they are?
  19. Actually this CSRF routing issue is a custom job extending the CHttpRequest class, there are some details of it in this thread, im going to get that done tomorrow. This is the link i found info for noCsrfValidationRoutes configuration http://www.yiiframework.com/forum/index.php/topic/14173-disable-csrf-token-validation-for-certain-paths/ Surprised Yii didn't bother to include that themselves it seems to be something that should be implemented.
  20. That noCsrfValidationRoutes configuration that Larry mentioned allows you to switch of some of the routes so then the ajax requests won't need them. Now you will know how i feel Jonathon when i was told its better to use Cents and not floats for monetary values, ive got that issue as well as CSRF to deal with. @Larry Thanks for that i thought it may be wasn't necessary for the ajax requests, okay ill do as you say. Actually now i know of the cents method i have decided to go back and recode some of the main web pages of my site. Most of last year i was learning stuff and coding at the same time but now i am writing better code with better understanding. I probably don't need to rabble on like this but i thought i would keep you up to date as your like man that wrote the "Holy Bible of Coding" for me.
  21. Cool so there is a way to turn it off in certain places. Larry should we use CSRF for only ajax requests or just for standard POST requests? What i mean is can somebody blind attack and only ajax function with 'ajaxOnly + new' set in the controller.
  22. That's kind of what i thought, it means if i enable it i will have to update many ajax functions, its a shame you can't just make it independent per form but yii only seems to offer it via that main.php like switch. I think to tighten up security i am going to enable it. Once again sorry to interupt i hope Larry can answer your question very soon when he gets time. Thanks for your help Jonathon. The least i can do is UP your post. Thanks
  23. Jonathon i am sorry to interupt but i want to ask a few questions.. Did you enable Csrf on all your forms by adding 'enableCsrfValidation'=>true? If you submit a form through a controller function with 'ajaxOnly + new', can somebody still do a blind attack on one of those? If you used Csrf when would you use it and why? I am sorry i don't have much experience with Csrf and if i enable the feature in Yii most of my site won't work.
  24. I thought it wasn't possible now i have learned more than one new thing today. Sometimes i think its better when its easier to read the code, imagine someone else comes to update your code, having nested tenary operators will make it more confusing for for them to interpret and they might spend 10 times longer to do the job. Have you every looked at the Drupal code its like kindergarten to what we are doing now. Yii kicks its as big time...
  25. Yeah i like the way Stripe works as well, all their API is simple and easy to follow. Unfortunately the Stripe monster doesn't have arms that reach me yet, i hope they grow longer soon. Or may be i will get a new ambitous idea of producing a Stripe clone in Asia, just kidding.
  • Create New...