Search Results

Search found 768 results on 31 pages for 'cakephp 2 0'.

Page 22/31 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • 'Previous' Button in HTML/PHP

    - by vlad
    Hi there, I thought hours about that problem but I didn't come to any conclusion. My problem here is that I need a 'Previous' Button added to a form. The user should fill out a formular that is splitted up in 13 parts. Every part is an own formular having a 'Next' button for submitting everything to a database and redirecting to the next page. How do I integrate a 'Previous' button there? ... I don't if it might be usefull for you to know that I'm using cakePHP, and well I'm pretty new to it.

    Read the article

  • Adding an additional link button to a form (using form->create)

    - by cloudhead
    I have recently been assigned a CSS & design project that's in a CakePHP environment and would like to know if I can add an additional button to the form, for a "sign up" link. The form is currently: echo $form->create('User', array('action' => 'login')); echo $form->inputs(array( 'legend' => 'Please log in:', 'username', 'password')); echo $form->end('Login'); I would like to inject a button that goes to an action of 'register', preferably after the "Login" button, on the same line, like this: username: [ ] password: [ ] [Log In] [Register] I have everything but the 'register' button. Is this possible using the 'automagic' form creation? Thank you.

    Read the article

  • Accessing individual HABTM records in a form

    - by Pichan
    I'm building a form in my CakePHP project that lets you edit a company's information. Among all other things, every company has at least one geographical area in which the company operates, but it may have more. The areas are selected individually using select dropdowns. The relationship between companies and areas is HABTM, because I need to be able to change the amount of associated areas without modifying the database. Currently the associations and corresponding data are handled separately, which isn't really a problem but I was wondering how it could be done using as much Cake's own 'automagic' functionality as possible?

    Read the article

  • could you build Stackoverflow with Drupal 7?

    - by ajsie
    im wondering if one can/should build a site like Stackoverflow with Drupal 7? we all know what Stackoverflow is and how it looks like. users <- threads <- tags and the openid stuff, validation etc. if you are going to build a site exactly as SO, will you use Drupal 6/7 or a MVC framework like CakePHP, CodeIgniter...? try to be realistic here and think about the actual work to do and how to implement with or without Drupal, not just "Drupal has nice features you can use and extend". would be helpful. thanks!

    Read the article

  • Using a single PHP script for an entire site

    - by briggins5
    I had an idea today (that millions of others have probably already had) of putting all the sites script into a single file, instead of having multiple, seperate ones. When submitting a form, there would also be a hidden field called something like 'action' which would represent which function in the file would handle it. I know that things like Code Igniter and CakePHP exist which help seperate/organise the code. Is this a good or bad idea in terms of security, speed and maintenance? Do things like this already exist that i am not aware of?

    Read the article

  • compromised site

    - by pinniger
    So, I have a web site that has been compromised twice in two weeks. every index.php and .js file gets a script injecting into the source code of the file. The problem is that I have no idea how they're doing it. I've seen this done via sql injection before, but I don't know how they are actually writing to the file. I've dug through the Apache logs but didn't find anything interesting. The site is built using the cakephp framework on a godaddy shared server. Anybody know what secturity settings or log files to check to see how they are doing this?

    Read the article

  • How can I find all records for a model without doing a long list of "OR" conditions?

    - by gomezuk
    I'm having trouble composing a CakePHP find() which returns the records I'm looking for. My associations go like this: User -(has many)- Friends , User -(has many)- Posts I'm trying to display a list of all a user's friends recent posts, in other words, list every post that was created by a friend of the current user logged in. The only way I can think of doing this is by putting all the user's friends' user_ids in a big array, and then looping through each one, so that the find() call would look something like: $posts = $this->Post->find('all',array( 'conditions' => array( 'Post.user_id' => array( 'OR' => array( $user_id_array[0],$user_id_array[1],$user_id_array[2] # .. etc ) ) ) )); I get the impression this isn't the best way of doing things as if that user is popular that's a lot of OR conditions. Can anyone suggest a better alternative?

    Read the article

  • Why repeat database constraints in models?

    - by BWelfel
    In a CakePHP application, for unique constraints that are accounted for in the database, what is the benefit of having the same validation checks in the model? I understand the benefit of having JS validation, but I believe this model validation makes an extra trip to the DB. I am 100% sure that certain validations are made in the DB so the model validation would simply be redundant. The only benefit I see is the app recognizing the mistake and adjusting the view for the user accordingly (repopulating the fields and showing error message on the appropriate field; bettering the ux) but this could be achieved if there was a constraint naming convention and so the app could understand what the problem was with the save (existing method to do this now?)

    Read the article

  • Access shell methods in controller? Cake PHP 1.3

    - by anonymous coward
    I wrote a shell method in CakePHP 1.3 that has a return value. I'd like to be able to access that method from within a controller, so that I can pass its return value into the View. I'm not sure how to access those methods appropriately from within the controller. Have I done it wrong? I could easily duplicate the code, but I'd like to "keep it DRY", and the actual functionality, I believe, doesn't belong with this particular controller - I just need it's return value in this particular view.

    Read the article

  • php and SQL_CALC_FOUND_ROWS

    - by Lizard
    I am trying to add the SQL_CALC_FOUND_ROWS into a query (Please note this isn't for pagination) please note I am trying to add this to a cakePHP query the code I currently have is below: return $this->find('all', array( 'conditions' => $conditions, 'fields'=>array('SQL_CALC_FOUND_ROWS','Category.*','COUNT(`Entity`.`id`) as `entity_count`'), 'joins' => array('LEFT JOIN `entities` AS Entity ON `Entity`.`category_id` = `Category`.`id`'), 'group' => '`Category`.`id`', 'order' => $sort, 'limit'=>$params['limit'], 'offset'=>$params['start'], 'contain' => array('Domain' => array('fields' => array('title'))) )); Note the 'fields'=>array('SQL_CALC_FOUND_ROWS',' this obviously doesn't work as It tries to apply the SQL_CALC_FOUND_ROWS to the table e.g. SELECTCategory.SQL_CALC_FOUND_ROWS, Is there anyway of doing this? Any help would be greatly appreciated, thanks.

    Read the article

  • Best way to integrate searching with pagination

    - by Vijay Choudhary
    I have a web application build on cakephp 2.x. I have integrated pagination on my data. Now i want to implement searching on that data also, and pagination should work according to search result. Now my question is: Should i use a form to post my search string. If so, then which method should i use, GET or POST. OR, should i use javascript window.location method, and append the search string to it. If we use this method then search string can append more than once to url. Or any other best way to implement this. Can anybody give the best solution for this as it is a common task for each application to have.

    Read the article

  • Paginator (Migration from Cake 1.3 to 2.0

    - by Christian Waschke
    i am struggling with the paginator in cakephp 2.0. While i am trying to migrate my application to 2.0 i cant find any solution to jump directly to the last page. In 1.3 it was quiet to do that from outside like this: echo $this->Html->link(__('Flights'), array('controller' => 'flights', 'action' => 'index','page' => 'last')); but this little trick putting 'page:last' in does not work anymore in 2.0. Of course there is a Paginator function called last, but this would only help if i would be already inside the app. My Problem is to access from an outside link directly the last page of the paginator. Thank you for reading, cdjw

    Read the article

  • PHP Framework Benefits / Downfalls

    - by Lizard
    I have been a PHP developer for about 10 years now and until about a month ago I have never used a framework. The framework I am now using due to an existing codebase is cakePHP 1.2 I can see certain benefits of the frameworks with the basic helpers like default layouts. I can definitely see the benefits of MVC keeping the logic separate etc. But the query building just seems to be bloated. Is this expected? Am I likely to be able to build better queries than the framework could build? I just feel I could get my apps running better without a framework. What are your thoughts?

    Read the article

  • What framework would allow for the largest coverage of freelance developers in the media/digital mar

    - by optician
    This question is not about which is the best, it is about which makes the most business sense to use as a company's platform of choice for ongoing freelance development. I'm currently trying to decide what framework to move my company in regarding frameworks for web application work. Options are ASP.NET MVC Django CakePHP/Symfony etc.. Struts Pearl on Rails Please feel free to add more to the discussion. I currently work in ASP.NET MVC in my Spare time, and find it incredibly enjoyable to work with. It is my first experince with an MVC framework for the web, so I can't talk on the others. The reason for not pushing this at the company is that I feel that there are not many developers in the Media/Marketing world who would work with this, so it may be hard to extend the team, or at least cost more. I would like to move into learning and pushing Django, partly to learn python, partly to feel a bit cooler (all my geeky friends use Java/Python/c++). Microsoft is the dark side to most company's I work with (Marketing/Media focused). But again I'm worried about developers in this sector. PHP seems like the natural choice, but I'm scared by the sheer amount of possible frameworks, and also that the quality of developer may be lower. I know there are great php developers out there, but how many of them know multiple frameworks? Are they similar enough that anyone decent at php can pick them up? Just put struts in the list as an option, but personally I live with a Java developer, and considering my experience with c#, I'm just not that interested in learning Java (selfish personal geeky reasons) Final option was a joke http://www.bbc.co.uk/blogs/radiolabs/2007/11/perl_on_rails.shtml

    Read the article

  • Manually start session with specific id / transitioning session cookie between domains

    - by deceze
    My host requires me to use a different domain for SSL secured access (shared SSL), so I need to transition the user session between two domains. One part of the page lives at http://example.com, while the SSL'd part is at https://example.hosting.com. As such I can't set a domain-spanning cookie. What I'm trying to do is to transition the session id over and re-set the cookie like this: http://example.com/normal/page, user clicks link to secure area and goes to: http://example.com/secure/page, which causes a redirect to: https://example.hosting.com/secure/page?sess=ikub..., which resurrects the session and sets a new cookie valid for the domain, then redirects to: https://example.hosting.com/secure/page This works up to the point where the session should be resurrected. I'm doing: function beforeFilter() { ... $this->Session->id($_GET['sess']); $this->Session->activate(); ... } As far as I can tell this should start the session with the given ID. It actually generates a new session ID though and this session is empty, the data is not restored. This is on CakePHP 1.2.4. Do I need to do something else, or is there a better way to do what I'm trying to do?

    Read the article

  • Unable to render php files in browser

    - by p1
    Hello, I am very new to php, and I am trying to develop a facebook application using php. I am using Joyent as my hosting platform. Currently, I am trying to do some simple scripts in php and then build on them. However I am unable to see any php files being rendered properly in my application. For eg: I have a simple script called phpinfo.php: If I execute this on terminal like php phpinfo.php , I can see all the configurations. However if I try to access the same file as http://xxxxxx.facebook.joyent.us/phpinfo.php, I get : Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Even if I rename this file to index.php its still the same. However I am able to access other html files [index.html] on the same location . These are some of my php settings: These are some of the settings: [fbkusoni:~/web/public] aafhe7vh$ php phpinfo.php | grep On allow_url_fopen = On = On auto_globals_jit = On = On enable_dl = On = On file_uploads = On = On ignore_repeated_errors = On = On ignore_repeated_source = On = On implicit_flush = On = On log_errors = On = On register_argc_argv = On = On report_memleaks = On = On y2k_compliance = On = On Multibyte regex (oniguruma) backtrack check = On mysql.allow_persistent = On = On session.bug_compat_warn = On = On session.use_cookies = On = On suhosin.cookie.cryptdocroot = On = On suhosin.cookie.cryptua = On = On suhosin.mt_srand.ignore = On = On suhosin.protectkey = On = On suhosin.server.encode = On = On suhosin.server.strip = On = On suhosin.session.cryptdocroot = On = On suhosin.session.cryptua = On = On suhosin.session.encrypt = On = On suhosin.srand.ignore = On = On suhosin.stealth = On = On The answer might be very naive, but I am just trying to get started and looking for any suggestions regarding this and also using Joyent and cakephp to develop facebook applications. Thanks.

    Read the article

  • Facebook Like Meta Tags not showing Images

    - by Hooman Ahmadi
    I have implemented the Facebook Like button on all our pages and it works properly by posting to Facebook with the correct meta tags. However, the images do not show in Facebook. The image meta tags show up properly when I use the Facebook Linter, but they don't show on someone's facebook page where the Like is posted on their wall. Also, is there any way to have the info recache more often? The tags take forever to update. Our site is built with CakePHP. Below are snippets of my code, thanks: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> <script type="text/javascript" src="http://use.typekit.com/wlx8xgm.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <?php if(!isset($meta_title)) { $meta_title = $title_for_layout; } if(!isset($meta_location)) { $meta_location = null; } if(!isset($meta_image)) { $meta_image = null; } if(!isset($meta_type)) { $meta_type = null; } ?> <meta property="og:title" content="<?= $meta_title ?>"/> <meta property="og:type" content="<?= $meta_type ?>"/> <meta property="og:url" content="<?= $meta_location ?>"/> <meta property="og:image" content="<?= $meta_image ?>"/> <meta property="fb:admins" content="1004432800"/> ... echo '<br><br><fb:like href="' . $fbook_url . '" width="300" height="80" layout="standard" show_faces="true" colorscheme="light"></fb:like>';

    Read the article

  • What are good hosting companies for PHP 5.3 Mysql / CouchDb / MongoDB Dev ( Lithium / CakePHP Framew

    - by Abba Bryant
    I am looking for a quality reliable host for some lithium development. I don't mind a shared platform as long as I have some ssh access. I require php 5.3.x, Mysql 5.x, and the usual imageMagick etc. Non-relational DB support up front would be nice but if they let me set one up myself I would be okay with doing it. I don't need a lot in the way of control panel tools. Good ones are appreciated but bad ones I would prefer not to even deal with. I don't anticipate needing much in the way of email but mail support would be nice to have. Cost isn't a big issue. I don't want to pay an arm and a leg but don't mind paying for what I need. Good support and decent uptime would be nice but I don't need an SLO or anything.

    Read the article

  • Web application architecture, and application servers?

    - by seanieb
    Hi, I'm building a web application, and I need to use an architecture that allows me to run it on two servers. The application scrapes information from other sites periodically, and on input from the end user. To do this I'm using Php+curl to scrape the information, Php or python to parse it and store the results in a MySQLDB. Then I will use Python to run some algorithms on the data, this will happen both periodically and on input from the end user. I'm going to cache some of the results in the MySQL DB and sometimes if it is specific to the user, skip storing the data and serve it to the user. I'm think of using Php for the website front end on a separate web server, running the Php spider, MySQL DB and python on another server. As you can see I'm fairly clueless. I'm familiar with using Php, MySQL and the basics of Python, but bringing this all together using something more complex than a cron job is new to me. How do go about implementing this? What frame work(s) should I use? Is MVC a good architecture for this? (I'm new to MVC, architectures etc.) Is Cakephp a good solution? If so will I be able to control and monitor the Python code using it?

    Read the article

  • Trouble with Router::url() when using named parameters

    - by sibidiba
    I'm generating plain simple links with CakePHP's HtmlHelper the following way: $html->link("Newest", array( 'controller' => 'posts', 'action' => 'listView', 'page'=> 1, 'sort'=>'Question.created', 'direction'=>'desc', )); Having the following route rule: Router::connect('/foobar/*',array( 'controller' => 'posts', 'action' => 'listView' )); The link is nicely generated as /foobar/page:1/sort:Question.created/direction:desc. Just as I want, it uses my URL prefix instead of controller/action names. However, for some links I must add named parameters like this: $html->link("Newest", array( 'controller' => 'posts', 'action' => 'listView', 'page'=> 1, 'sort'=>'Question.created', 'direction'=>'desc', 'namedParameter' => 'namedParameterValue' )); The link in this case points to /posts/listView/page:1/sort:Question.created/direction:desc/namedParameter:namedParameterValue. But I do not want to have contoller/action names in my URL-s, why is Cake ignoring in this case my routers configuration?

    Read the article

  • Lost Array After Validation Error

    - by Georges Kmeid
    I'm working on a CakePHP project and I have User, Post and Location models among others. User hasMany Location and Post belongsTo User so Location is not directly related to Post. This is my code in the Post controller: public function add() { if ($this->request->is('get')) { $this->loadModel('Location'); $this->set('locations', $this->Location->find('all', array('conditions' => array('user_id' => $this->Auth->user('id'))))); } ... } And this is my code in the posts/add view: <?php $i = 0; $j = 0; foreach ($locations as $location): $location_names[$i] = $location['Location']['name']; $i++; endforeach; echo "<select name=\"location\" onchange=\"select(this.value)\">"; echo "<option value=\"\">Select a saved location</option>"; foreach ($locations as $location): echo "<option value=\"" . $location['Location']['latitude'] . "," . $location['Location']['longitude'] . "\">" . $location_names[$j] . "</option>"; $j++; endforeach; ?> </select> If I enter a wrong value in one of the post inputs that has a validation rule in Post model, it redirects to the current add view, shows what is the validation error, but then the $locations array passed from controller to view disappears and can't use it in view and I get this error: Notice (8): Undefined variable: locations [APP\View\Posts\add.ctp, line 68]

    Read the article

  • JQuery AJAX returned too much data that I had not requested

    - by kwokwai
    Hi all, I am using CakePHP 1.26 and CDN JQuery in this URL: http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js In a HTML web page, I have these lines of code: $.ajax({ type: "POST", url: "http://mywebsite.com/controllers/avail/"+curl, success: function(data) { alert(data);} }); and in the PHP page, I got another few lines of code: function avail($uname){ $result1=$this->Site1->User->findByusername($uname); if($result1){ return 1; } else{ return 0; } } As you see, the Avail function will return either zero or one. But there was some redundant data returned from the server, what I saw in the Alert box was somthing like this (rather than 0 or 1): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Missing Method in Controller</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <style type="text/css"> /* CSS Document */ /*PAGE LAYOUT*/ 0

    Read the article

  • how to create aro using dbAcl using console

    - by Praveen kalal
    hi i am using cakephp for my project but whille creating acl using command promt. when i run the following command cake schema run create DbAcl it genrate three tables in database. but after puting the following code in users_controller.php. and this command. cake acl view aro it dont create aros. function index() { $aro =& $this->Acl->Aro; //pr($aro); exit; //Here's all of our group info in an array we can iterate through $groups = array( 0 => array( 'alias' => 'admins' ), 1 => array( 'alias' => 'guests' ), 2 => array( 'alias' => 'mangers' ) ); //Iterate and create ARO groups foreach($groups as $data) { //Remember to call create() when saving in loops... $aro->create(); //Save data $aro->save($data); } }

    Read the article

  • Matching innermost braces with regex or strpos?

    - by rich97
    I have a sort of mini parsing syntax I made up to help me streamline my view code in cakephp. Basically I have created a table helper which, when given a dataset and (optionally) a set of options for how to format the data will render out a table, as opposed to me looping though the data and editing it manually. It allows the user to be as complex or as simple as they like, it can get pretty powerful. However, In order to achieve this I had to make a simple parsing syntax. As a quick example the user would do something like so: $this->Table->data = $userData; $this->Table->elements['td']['data'] = array( '{:User.username:}', '{:User.created:}' => array('Time::nice') ); echo $this->Table->render(); And when rendering the table would then generate: <table> <tbody> <tr><td>rich97</td><td>Sun 21st 02:30pm</td></tr> </tbody> </table> The problem occurs then I try to nest the braces like so: {:User.levels.iconClasses.{:User.access:}:} Is there anyway I can only get the inner most brackets on the first time round and loop though until there are no matches? Or even do it in one go? Or even better use strpos? Here is my regex as it stands: '/\{\:([^}]+)\:\}/'

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >