Welcome Guest, Not a member yet? Register   Sign In
Need FLASH DATA NEED HELP
#3

[eluser]razerone[/eluser]
[quote author="CroNiX" date="1383411501"]You didn't post the view, which is where it would be displayed.

What is this doing? I don't see you doing anything with $success after you create it (you don't pass it anywhere or anything), but you try to read the session data here before you actually create the session data.
Code:
$success['flash'] = $this->session->flashdata('success');
$this->session->set_flashdata('success', 'Message Has Been Submitted Successfully');

All you really need here is to set the session data in the controller:
Code:
$this->session->set_flashdata('success', 'Message Has Been Submitted Successfully');

And then display it if it exists in the view:
Code:
$message = $this->session->flashdata('success');
<?php if ($message !== FALSE): ?>
<div class=“alert alert-success”>&lt;?php echo $message; ?&gt;</div>
&lt;?php endif; ?&gt;
[/quote]

Sorry for late reply I did work that out last night.

Controller

Code:
$data_success['message_success'] = '<div class="alert alert-success">Your Message Has Been Recived Will Get Back To You In 24/48 Hours</div>';

View

Code:
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
&lt;?php if (isset ($message_success)) : echo $message_success; endif; ?&gt;
</div>
</div>

But people say. it is best to make a data variable for it would you know what I would need to do?

Also on another topic. when my validation kicks in the content that was entered correct goes ways and have to re enter it I only want to be able to re enter the validation errors if any comes up.


Messages In This Thread
Need FLASH DATA NEED HELP - by El Forum - 11-01-2013, 08:14 PM
Need FLASH DATA NEED HELP - by El Forum - 11-02-2013, 09:58 AM
Need FLASH DATA NEED HELP - by El Forum - 11-02-2013, 07:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB