#6243: query string parameter passed not handle properly
----------------------------------+-----------------------------------------
    Reporter:  framework_starter  |         Owner:           
        Type:  Bug                |        Status:  new      
    Priority:  Critical           |     Milestone:  1.2.x.x  
   Component:  General            |       Version:  1.2 Final
    Severity:  Normal             |    Resolution:           
    Keywords:                     |   Php_version:  PHP 5    
Cake_version:  1.2.2.8120         |  
----------------------------------+-----------------------------------------
Comment (by framework_starter):

 following is the controller and view's code

 ====================== users_controller.php controller
 =========================

 <?php

 // filename: users_controller.php

 class UsersController extends AppController{
         var $name = 'Users';
         var $helpers = array('Html','Form');
         var $uses = array();

         function index(){
                 if(!empty($this->data)){
                         $this->redirect(array('controller' => 'users',
 'action' => 'welcome',
 'name'=>urlencode($this->data['name'])
                                                                 )
                                                         );
                 }
         }

         function welcome($name=null){
                 if(empty($name)){
                         $this->Session->setFlash('please provide your
 name',true);
                         $this->redirect(array('controller' => 'users',
 'action' => 'index')
                                                         );
                 }
                 // here i found some bug it only shows
                 // "abc" not "abc & xyz" as we passed "abc & xyz"
                 // from view input box named "name"
                 echo urldecode($name);
                 $this->autoRender = false;
                 //$this->set('name',urldecode($name));
         }

 }
 ?>

 ========================= index.ctp view
 ===================================

 <?php
         //filename: index.ctp

         echo $form->create(null,array('action' => 'index'));
 ?>
 <fieldset>
 <legend>Enter your name</legend>
 <?php echo $form->input('name'); ?>
 </fieldset>
 <?php echo $form->end('submit'); ?>

 ========================= welcome.ctp view
 ===================================
 <h2>Welcome <?php echo $name; ?></h2>

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6243#comment:2>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to 
tickets-cakephp+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to