0
I’m trying to create a simulator where the user can change the image, but when he closes the Browser, returns the source image, which is recorded in the BD.
I have been researching and I saw that using $_SESSION I could get the expected result, but I am very lay, and I am not getting the result.
If friends can shed some light on how I should proceed to such a task, I would be most grateful.
Below the code I’m trying to use...
<?php
// Start the session
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
// Set session variables
$_SESSION["logo"] = "8081.png";
?>
</body>
</html>
<img width="200" src="img/<?php echo $_SESSION['logo']; ?>" />
<?php
$img = $_SESSION["logo"]["tmp_name"];
$logo=$_FILES["logo"]["name"];
copy($img,$logo);
?>
<form method="get">
<input type="file" accept="image/*" name="$_SESSION['logo']"><br>
<input type="submit" name="logo" value="Atualizar">
</form>
Waiting for good tips, hugs to everyone.
Hello Anderson, if you enter the address (http://www.efacil.com), you will have an idea of what I need. I’ll explain in more detail, okay? Hugs.
– Murilo Cabral