I'm trying to create a web page that when user click on the below link,it will bring user to the next page

<a href="../try/sewcutrptsummary?pro={$row ->idmsul}" target="blank"">Link

My question is,how can i retrieve the same data from 1st page & display it in a textbox in 2nd page as shown in below pictuce?


This is the view for the 2nd page

<div class="control-group">
<label for="proid" class="control-label">MSUL ID</label>
<div class="controls"> 
 <input type="text" id="txtinput" name="txtinput"value="">
<select id="prodtype" name="prodtype"onchange="checknumber();">
<option selected >--Select Product Type--</option>
 <option value="Main"  >Main</option>
 <option value="Sub">Sub</option>
<div class="controls" id="after" style="display : none">         
<select id="cutprod" name="cutprod" class="input-xxlarge">

<input id="generatebtn" type="button" class="btn-primary btn-small" onclick="generateRpt();" value="Generate" ></div>

and this is the controller for the page

function index() {
        $this -> smarty -> assign("page", "View Cutting Report Summary");
        $this -> smarty -> assign("dataname", "Cutting Report Summary");
        $this -> smarty -> assign("pagename", "sewcutrptsummary");
        $this -> smarty -> assign("msg", "");
        $this -> smarty -> assign("script", "Yes");

        $idmsul = $this -> input -> get_post("pro");
        $query = "Select idmsul from sindi_schedule where idmsul='{$idmsul}' group by idmsul";
        $result = $this -> global_model -> query($query) -> result();
        $data['idmsul'] = $result;

        $this -> smarty -> view('sewcutrptsummary.tpl',$data);

when i try to use print_r($data); to check the data,it display

Array ( [idmsul] => Array ( [0] => stdClass Object ( [idmsul] => JS-F1701060-1L ) ) )

which mean the data is there,but i don't know how to display it in my textbox.

Can anybody assist me on this problem?

Your help is greatly appreciate.


if you expect only one single row from the query, then instead of:

$result = $this -> global_model -> query($query) -> result();

Use row():

$result = $this -> global_model -> query($query) -> row();

So you can do:

echo $result->idmsul;

Otherwise use a loop. See the documentation at:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.