hi,
i m on one script where i want to store data of one variable in to the
file by creating in in script itself.
i have collected data as fallows in $stateJs variable.

<?php
class CitiesController extends AppController{
        var $name = 'Cities';
        var $helper = array('html' ,'form');
        var $uses = array('City', 'State');

        function admin_select(){
                $states = $this->State->find('all', array('order' =>
array('State.created DESC')));
//              print_r($states);exit;
                        $stateJs ="";
                foreach($states as $state){
                        $stateJs .= 'var'." 
".$state['State']['title']."".'_list'."".'=';
                        $stateJs .= "<SELECT NAME='drpcity' id='drpcity'
class='dropdown1_adpro_businesstype'
onchange='enable_othercity(this.value);'                                        
                        style='width:
170'><OPTION VALUE='sel'>--------- Select a City ---------</OPTION>";
                        $cities = $this->City->find('all',
array('conditions'=>array('state_code'=>$state['State']
['state_code'])));
                //print_r($cities);exit;
                foreach($cities as $city){
                        $stateJs .="<option value= ".$city['City']['id'].">";
                        $stateJs .= $city['City']['title'];
                        $stateJs .= "</option>";
                        }
                }

                $stateJs .= "</select>\n";
                echo $stateJs;
                }
        }

?>

now i want to store $stateJs variable data by creating a file in
script.

can anyone help me out in this,
please !

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to