Gliomas are one of the most frequent types of nervous system tumours and have significant morbidity and mortality rates. As a result, it is critical to fully comprehend the molecular mechanism of glioma to predict prognosis and target gene therapy. The goal of this research was to discover the hub genes of glioma and investigate their prognostic and diagnostic usefulness. In this study, we collected mRNA expression profiles and clinical information from glioma patients in the TCGA, GTEx, GSE68848, and GSE4920 databases. WGCNA and differential expression analysis identified 170 DEGs in the collected datasets. GO and KEGG pathway analyses revealed that DEGs were mainly enriched in gliogenesis and extracellular matrix. LASSO was performed to construct prognostic signatures in the TCGA cohort, and 17 genes were used to build risk models and were validated in the CGGA database. The ROC curve confirmed the accuracy of the prognostic signature. Univariate and multivariate Cox regression analyses showed that all independent risk factors for glioma except gender. Next, we performed ssGSEA to demonstrate a high correlation between risk score and immunity. Subsequently, 7 hub genes were identified by the PPI network and found to have great drug targeting potential. Finally, RPL39, as one of the hub genes, was found to be closely related to the prognosis of glioma patients. Knockdown of RPL39 in vitro significantly inhibited the proliferation and migration of glioma cells, whereas overexpression of RPL39 had the opposite effect. And we found that knockdown of RPL39 inhibited the polarization and infiltration of M2 phenotype macrophages. In conclusion, our new prognosis-related model provides more potential therapeutic strategies for glioma patients.