Galera is as follows, I have a standard html file, which contains:
<header data-color="<?php echo $client->client_color; ?>">
<h1>
<?php if($client->client_image != ''): ?>
<img src="<?php echo $client->client_image; ?>" alt="<?php echo $client->name; ?>"/>
<?php else: ?>
<?php echo lang('client_title'); ?></h1>
<?php endif; ?>
...
But I did a function in the controller, for the client to have the option of passing the image and the color per parameter in url:
private function SetImageAndColor($client_id) {
if(isset($_GET['color']) AND isset($_GET['image'])) {
$dados['client'] [$client_id] ['image'] = $this->input->get('image');
$dados['client'] [$client_id] ['color'] = $this->input->get('color');
$this->session->set_userdata('client', $dados);
}
}
How do I check if $_GET
exists, it puts the image and the color selected by the client, if not, does it set the default?