The aim of this study was to prepare and optimize a novel type of in situ gel-forming solid dosage form (gfSDF) to be used in the treatment of mucosal/skin ulcerations. For this purpose, a simple but reliable syringe-based hot melt/moulding method was employed. Chloramphenicol (antibiotic) and ibuprofen (anti-inflammatory) were chosen as model active pharmaceutical ingredients (APIs) to be loaded into the gfSDFs. To optimize the formulations, the gfSDFs of different compositions were studied in terms of APIs release from the matrix, solid-state characteristics, gellification properties and gfSDFs resistance to mechanical stress. Release studies showed that both APIs were released at a constant rate at different pH (pH 5 and 7.4, respectively) and the changes in the formulation composition affected the release behaviour. Differential scanning calorimetry (DSC) results evidenced the complete solubilization of both API in the solid matrix. Texture analysis showed that the gfSDFs were capable of swelling once in a contact with aqueous environment and that the textural properties changed extemporaneously from the solid to gel form. The gel formed after hydration exhibited high cohesiveness and adhesiveness, an indication of good mucoadhesion properties. Friability testing confirmed satisfactory physical strength for a solid dosage form.