Pass variable in a URL
You can pass in a variable into a function. Something like this:

void runCurl(int verdi) {
    ...
    String myUrl = "student.cs.hioa.no/~s180343/updatedb.php?verdi=";
    myUrl += verdi;
    p.addParameter(myUrl);
    ...
}


You call the function like this, now:

runCurl(1);
runCurl(2);
runCurl(someVar);


and so on. Since it's already in your main loop() function, you just need to set pass in a different number based on whatever it is you're trying to do.