Welcome Guest, Not a member yet? Register   Sign In
how to send messages between pages?
#1

[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)
#2

[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




Theme © iAndrew 2016 - Forum software by © MyBB