Welcome Guest, Not a member yet? Register   Sign In
[Solved] CI Sessions does not accept space
#1

[eluser]Nine[/eluser]
I am currently coding for my thesis and I am new to the CI Framework. This is my second project with CI. Our thesis is about online booking for a photography service. I usually find my answers to google, but this issue bugs me.

I am wondering why CI Sessions can only store one word. E.g. when saving a full name, it can only store the first name thus not including the middle name and surname.

model:
Code:
if($this->input->post('txt_organizer') != '') {
$this->session->set_userdata('organizer',$this->input->post('txt_organizer'));
}
where 'organizer' is the name of the wedding planner.

view:
Code:
<tr>
<td>Wedding Planner's Name</td>
<td>:</td>
<td colspan=2 >&lt;input type=text name="txt_organizer" id="txt_organizer"
  &lt;?php
   if(isset($_GET['txt_organizer']) && !$this-&gt;session->userdata('organizer')){
    echo "value=".$_GET['txt_organizer'];
   }
        
   if($this-&gt;session-&gt;userdata('organizer')){
    echo "value=".$this->session->userdata('organizer');
   }
  ?&gt;
  ></td>
<td></td>
</tr>

Is it really a CI rule to store only one word(without spaces)? Or did I do something with Session settings or just did not implement this well? Regular Php sessions can store spaces.
#2

[eluser]Nine[/eluser]
If CI Sessions can't store spaces, I will opt to use SQL codes, and skip Sessions. .
#3

[eluser]Nine[/eluser]
Got it now.
It has nothing to do with sessions.
When I was displaying the value in the textbox the first word was the only string displayed because the whole phrase was not in a quotes.

Solved it this way:
Code:
echo "value='".$this-&gt;session-&gt;userdata('organizer')."'";

*inner quotes within the echo quotes . . Whew. . Things solved on my own makes me feel better.





Theme © iAndrew 2016 - Forum software by © MyBB