I have an image viewing page which resizes an image to a sensible sizebefore
displaying. The user should then be able to choose "25% larger" or smaller
and the resized image display. The problem I am getting with the code below
is that whatever the POST variable value (and I have tested the value
changes correctly), the line marked with *** executes, ie the image gets
smaller. Am I missing some obvious subtlety with IF statements?
Also, when the page reloads, it still displays the previous (ie non-resized)
image, despite the fact that I have confirmed that the actual image in the
directory has changed size. Is it the case that the image has been cached by
the browser? If so, how do I force a reload?
TIA Gaz
if(isset($_POST['submitScale'])) {
if ($_POST['scale'] = "25% smaller") {
resizeImageByPe rcent($thumbLoc ation, "resized", 75);
}
else if ($_POST['scale'] = "25% larger") {
resizeImageByPe rcent($thumbLoc ation, "resized", 125);
}
else if ($_POST['scale'] = "full size") {
resizeImageByPe rcent($original Location, "resized", 100);
}
}
.....blah blah blah some code
<form action="imagevi ew.php3?image_i d=<?echo $row["image_id"]?>"
method="POST">
Make this image <sel ect name="scale">
<option>25% smaller
<option>25% larger
<option>full size
</select>
<input type="submit" name="submitSca le" value="Go!">
</form>
displaying. The user should then be able to choose "25% larger" or smaller
and the resized image display. The problem I am getting with the code below
is that whatever the POST variable value (and I have tested the value
changes correctly), the line marked with *** executes, ie the image gets
smaller. Am I missing some obvious subtlety with IF statements?
Also, when the page reloads, it still displays the previous (ie non-resized)
image, despite the fact that I have confirmed that the actual image in the
directory has changed size. Is it the case that the image has been cached by
the browser? If so, how do I force a reload?
TIA Gaz
if(isset($_POST['submitScale'])) {
if ($_POST['scale'] = "25% smaller") {
resizeImageByPe rcent($thumbLoc ation, "resized", 75);
}
else if ($_POST['scale'] = "25% larger") {
resizeImageByPe rcent($thumbLoc ation, "resized", 125);
}
else if ($_POST['scale'] = "full size") {
resizeImageByPe rcent($original Location, "resized", 100);
}
}
.....blah blah blah some code
<form action="imagevi ew.php3?image_i d=<?echo $row["image_id"]?>"
method="POST">
Make this image <sel ect name="scale">
<option>25% smaller
<option>25% larger
<option>full size
</select>
<input type="submit" name="submitSca le" value="Go!">
</form>
Comment