Clicking on a text displaying that text in url but unable to show that text in view file.
View:
<div class="applynow"><a href="<?php echo base_url();?>career/apply/<?php echo $r->job_name;?>" class="applyforjob">Apply Now</a></div>
Clicking on the apply now button displaying the job name in URL. But The job name is not dislaying in view file.
Controller:career/apply
function apply()
{
$this->load->model('career_model');
$data['records2']= $this->career_model->getcareerdatas($this->uri->segment(3));
$data['mainpage']='apply';
$this->load->view('templates/template',$data);
}
Career Model:
function getcareerdatas($id)
{
$this->db->select('jobs_list.*');
$this->db->from('jobs_list');
$this->db->where(array('jobs_list.job_name'=>$id));
$q=$this->db->get();
if($q->num_rows()>0)
{
return $q->result();
}
else
{
return false;
}
}
View:
<form name="applynow" id="applynow" enctype="multipart/form-data" method="post" action="<?php echo base_url();?>apply/applynow">
<div class ="applyus">
<?php if(isset($records2) && is_array($records2)):?>
<?php foreach ($records2 as $r):?>
<span class="digit"><?php echo $r->job_name ;?></span>
<?php endforeach;endif;?>
<div class="applyfullname contactname">
<label for="fullname"><font color="black">Full Name</font><span class="mandatory"><font color ="red">*</font></span></label>
<input type="text" class="form-control names" name="fullname" id="fullname " value="<?php echo set_value('fullname');?>" placeholder="Full Name">
<?php echo form_error('fullname', '<div class="error">', '</div>'); ?>
</div>
<div class="applynowemail contactemail">
<label for="email"><font color="black">Email</font><span class="mandatory"><font color ="red">*</font></span></label>
<input type="email" class="form-control emails" id="email" name="email" value="<?php echo set_value('email');?>" placeholder="Email" >
<?php echo form_error('email', '<div class="error">', '</div>'); ?>
</div>
Clicking on apply now button it will open another page in that page it is not displaying the job name.
MYSQL:
+---------+--------------------+--------------------+-----------------+
| jobs_id | job_name | jobs_name | job_description |
+---------+--------------------+--------------------+-----------------+
| 1 | Junior QA Enginner | Junior_QA_Enginner | Description |
| 2 | Junior Engineer | Junior_Enginner | Description |
+---------+--------------------+--------------------+-----------------+