0
I ask for the help of friends, because I’m having difficulty creating an IF/ELSE to determine which content of the variable $logo
will enter first.
Here’s what I need when accessing the main page "http://www.efacil.com/", It’s easy to carry the logo (As this at the address mentioned for access) believing that SESSION has not yet been loaded. But after changing the image via Adm Panel.(Access by the mentioned address), the new image is loaded.
For this I tried to create PHP code (listed below) to determine when the session_start()
must load the variable referring to the image that was changed, but as I mentioned at the beginning of the POST, without success, because even after the image exchange, it keeps loading the logo of Easy Easy.
<?php
if(!isset($_SESSION)) { // Se a Session não for iniciada
$logo = 'img/logo_tipo.png'; // Carrega esse conteúdo
}else{ // Se não
@session_start(); // Inicia a session.
if(isset($_SESSION)) { // Se a Session for iniciada
$logo = ''.$_SESSION['logo'].''; // Carrega esse conteúdo
}}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title></title>
<link rel="shortcut icon" href="" />
</head>
<body style="margin:0;">
<div align="center" style=" margin-top:5px; width:100%;">
<img width="150" height="auto" src="<?php echo $logo; ?>" /><br />
</div>
</body>
</html>
Well I thank the attention of the friends, and in the await of good tips to solve my problem, in case it has solution.
Hugs to all.
Thanks to friends Miguel, André Baill and Localhost, for the tips and the solution was given with the tip of Localhost, because it was only add in the line of SESSION not started the variable
['logo']
to make it work perfect, but I also tested André Baill’s code, which worked perfectly exactly the way he posted it. Thanks Even, enter the address (http://www.efacil.com/) to see the result, because I will leave for some time on the air. Once again, my many thanks to friends, thanks even for the strength. Hugs to all.– Murilo Cabral