Texturing a cube face issue

Hi, I am learning opengl and have progressed onto texturing using pictures. I am trying to texture one face of a cube but the result is very weird.
image

      glEnable(GL_TEXTURE_2D);
      glBindTexture(GL_TEXTURE_2D, texture);
      glBegin(GL_POLYGON);
        glTexCoord2f( 1.0, -1.0);
        glVertex3f( 1.0, -1.0,  1);
        glTexCoord2f( 1.0, -1.0);
        glVertex3f( 1.0, -1.0, -1);
        glTexCoord2f( 1.0, 1.0);
        glVertex3f( 1.0,  1.0, -1);
        glTexCoord2f( 1.0, 1.0);
        glVertex3f( 1.0,  1.0,  1);
        glEnd();
        glDisable(GL_TEXTURE_2D);

The normals are applied correctly so its not that causing the issue. I then have a separate function to load the image:

QImage temp;
temp.load("./Example.ppm");   //load in image
QImage image = QGLWidget::convertToGLFormat(temp);   //convert to correct format

glEnable(GL_TEXTURE_2D);
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, pic.width(), pic.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.bits());

glBindTexture(GL_TEXTURE_2D, texture);

where texture is a global unsigned int. Any ideas what may be causing this issue? I tried using:

glPixelStorei (GL_UNPACK_ALIGNMENT, 1);

but that didn’t change anything.

Okay so I realised I was being dumb and only actually using 2 different texture coordinates (repeated same coords twice) but the issue remains of how do I texture it in the z direction without using a 3d image?

By using six 2D textures, one for each face. Or using a single 2D texture, mapping one sixth of it to each face.