CodeIgniter Forums
how to send messages between pages? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: how to send messages between pages? (/showthread.php?tid=12271)



how to send messages between pages? - El Forum - 10-13-2008

[eluser]Unknown[/eluser]
hi my friends, i am building an aplication with codeigniter
I want to send a message from the page 1(client) to the page 2(server) the message is personal information like name and last name.
BUT the page2(server) has to have a form including two option accept or deny, if we click accept save in data base. If we click deny, send a error message.
There is a example in the document but i dont know how to add the form or where to add it.
byeee.
(sorry, but my english is too bad)


how to send messages between pages? - El Forum - 10-13-2008

[eluser]hvalente13[/eluser]
Hi,

Try using Session Userdata:
Session Class.

In page1 you can use it in the form like this:

Code:
<form method="POST" action="page2">
<input id="name" value="">
<input id="lastname" value="">
</form>

Page 2
Code:
<?

$this->session->set_flashdata('name',$this->input->post('name'));
$this->session->set_flashdata('lastname',$this->input->post('lastname'));

?>

To use it if accept you can access it by
Code:
$dbdata = array(
'name' => $this->session->flashdata('name')
'lastname' => $this->session->flashdata('lastname')
);

$this->db->insert('table',$dbdata);

Hope this helps
Hvalente13