4
Hello, I am trying to create a simulator using SESSION, but as I am a beginner and very lay still, I am asking for the help of friends. Next I created the page where the user can change the logo, simple it selects the image and changes next to the BD, which in turn sends the new image to the address of the Site in the position of the user’s Logo-Brand.
But I would like to give the opportunity for the user to simulate some changes, but when leaving the browser the changes made by him were undone, returning to the original.
I ask friends how? And if there is how I should proceed?
Below I list the file you create to change the logo, and the logo file coming from the BD.
Aquivo that changes the logo:
<?php
include 'cabecalho.php';
$codigo = $_POST['codigo'];
$logo = $_POST['logo'];
$query = mysql_query("SELECT * FROM pagcabecalho") or die(mysql_error());
$res = mysql_fetch_array($query);
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<div align="center" style="margin: 0 0 0 180px; max-width:1000px;">
<div align="left" style="margin:0 0 0 10px;"><h3>Configure o Logo de Seu Site</h3></div>
<div align="left" style=" border-right:solid 2px; padding:10px; float:left; width:300px; height:auto; font-family:Verdana, Geneva, sans-serif; font-size:12px; font-weight:bold;">
<label>Logo: </label><br />
<label>Nome do arquivo: <span><?php echo $res['logo'];?></span><br />
<label>Imagem do arquivo: </label><br />
<img width="100" height="auto" src="../upload/<?php echo $res['logo'];?>" title="Logo Marca"/>
<br />
</div>
<div style="padding:10px; float:left; width:655px; height:auto; font-family:Verdana, Geneva, sans-serif; font-size:12px; font-weight:bold;">
<br /><br />
<div align="center" style=" padding:2px; float:left; width:190px; height:auto; float:left;">
<label>Configure o Logo:</label><br />
<a href="edit_logo-upd.php?codigo=<?php echo $res['codigo'];?>">
<img style="padding:15px;" width="30" height="auto" src="img/edit.png" title="Atualizar Imagem do Logo" /></a>
</div>
</div>
File that receives the BD logo:
<li><a href="index.php">
<img width="150" height="auto" src="upload/
<?php
include "../conexao.php";
$logo = $_POST['logo'];
$query = mysql_query("SELECT * FROM pagcabecalho");
$res = mysql_fetch_array($query);
echo $res['logo'];
?>
" title="Home"/></a>
</li>
If friends can shed some light on how I can create this simulator, I would be most grateful.
Hugs to all.
Wouldn’t it be ideal to use Javascript? It is possible to do something very 'cool', I will try to answer later. ;]
– Inkeliz
I stand by!
– Sergio Murilo Cabral
I haven’t forgotten you. ;]
– Inkeliz
Can you put the code that takes the POST/GET form, just to see how the variables are declared? That is, the code that does the
INSERT
in the image.– Inkeliz