Question: So, it's common practice, these days, to concatenate & minify our web app assets like `css` & `javascript`. Almost every technology stack, offers tools to do so.

What I'm wondering, is if there's a way to concatenate all my image resources. That would, I'm sure, load my image heavy site much faster.

I am aware of how this can be manually achieved (think stitching images in PS). I am also aware of algorithms that can automatically do that.

My questions are:

1. Has this become standard practice yet?
2. Are there tools already doing this?
3. Would it really help speed up the loading of the website (by the same logic, I think, it definitely should.

Answer: 
```
if ($_POST['selectbox']  === 'optone')

```

optone and opttwo are values
Is'nt this a better solution?

```
<form action="vote_action.php" method="post">
    <select name="selectbox">
        <option value="1">optone</option>
        <option value="2">opttwo</option>
    </select>
    <input type="submit" name="submit" value="submit" />
</form>

```

PHP:

```
if(isset($_POST['selectbox'])) {

$query = mysqli_query($con, "UPDATE mytable SET votes=votes+1 WHERE id=".$_POST['selectbox']."");

    if($query){
        echo "Updated"; 
    }

}

```

**Note: This is vunerable for SQL injection!**

**EDIT: Updated against users that are not doing what you want ;)**

```
$allowed_ids = array(1, 2);

if(isset($_POST['selectbox']) && in_array($_POST['selectbox'], $allowed_ids)) {

$selected = bin2hex($_POST['selectbox']);
$query = mysqli_query($con, "UPDATE mytable SET votes=votes+1 WHERE id=UNHEX('$selected')");

    if($query){
        echo "Updated"; 
    }

}

```