php - Rename image according to selected option in form? -
pretty simple question. have select option box made in html when option selected renames uploaded image according name of option. when uploading image s3, needs add rename. this:
$actual_image_name = $hoteldir . '-' . date("y-m-d_h:i:s"). "_" . $size . ".".$ext;
where $hoteldir room type or whatever set too.
here list example wants see it.
<select class="typeselect" name="roomtype" id="typeselect" required="true"> <optgroup label="main areas"> <option value="ext" name="ext">exterior</option> <option value="grm" name="grm">guest room</option> <option value="lby" name="lby">lobby</option> <option value="bth" name="bth">bathroom</option> <option value="rst" name="rst">resturant</option> <option value="ktc" name="ktc">kitchen</option> <option value="pol" name="pol">pool</option> </optgroup> <optgroup label="other"> <option value="msc" name="msc">miscellaneous</option> </optgroup> </select>
you looking $_post variable, use $_post['roomtype'] retreive it. aware of wrong data, , should validate you've got proper value in there.
Comments
Post a Comment