Avoid the Empty spaces between the ( &name=%d ) variables. If you give empty space means 20% will occur in the url. ( &name=emptyspace%d ) Avoid Like this , It's cause the %20 in the url: sprintf(' <a href="?page=list& name= %d " /> sharelist </a> ',$row['id'] ); Correct method : sprintf(' <a href="?page=list& name=%d " /> sharelist </a>',$row['id'] );