I am trying to create button thats redirect me to another page. I am trying to put variable in the link but the button isnt working.
this is my script:
$idSelect[i]="SELECT * FROM times WHERE id=" . $mid[i] . "";
$idResult[i]=mysqli_query($con,$idSelect[i]);
while($row = mysqli_fetch_array($idResult[i])) {
$uid[i]=$row['userid'];
}
$inc = "in.php?id=". $uid[i] ."";
echo "<input type='submit' value='back' class='button' onclick='window.location.href=". $inc ."'>";
notes:
- ID prints Int from databse.
echo $incis working, I checked it.
I tried few tutorials, and I read answers from for the same question but they didnt help
EDIT: I think my mistake is something with the onclick place, but I dont know what is the problem..
type='button'instead oftype='submit'