As part of a wider site admin area I have a photo upload script.
It should work as follows, after a single photo has been successfully uploaded the user is redirected to a gallery page with a success message, the photo they just uploaded is shown and there is a section to continue adding more photographs for that profile.
This works in my localhost environment and makes adding photos efficient and visually appealling.
On my production environment - a shared hosting server with 1and1 - when a user adds a single photo they are redirected to a blank page. The user then has to use the back button to get back to the upload controls.
My code is below;
<?php
//echo "New records created successfully";
header("Location: photos-gallery.php?user=" . $name . "&success=1");
die();
?>
<?php }else {?>
<?php
//echo "Error: " . $e->getMessage();
header("Location: " . $_SERVER['HTTP_REFERER'] . "&fail=1");
die();
?>
As I say, this works fine in my dev environment but not when I publish to the server, so I don’t think the code is incorrect - I’m wondering if it’s possible that it just doesn’t work on the server I have - but I am using the same type of redirect elswhere… Any thoughts?