#include <stdio.h>
#include <stdlib.h>
#include <string.h>

main()
{
char cgi[20000];
char *p;

memset(cgi,0,sizeof(cgi));
cgi[0]='&';
p=getenv("QUERY_STRING");
if(p!=NULL) 
	{
	strcat(cgi,"&");
	strcat(cgi,p);
	strcat(cgi,"&");
	}//if

//chop all trailing ampersands.
for(;;)
	{
	if(strlen(cgi)==0) break;
	if(cgi[strlen(cgi)-1]=='&') cgi[strlen(cgi)-1]=0;
	}//for



//printf("Content-type: text/html\n\n");
printf("Location: http://www.imageexchange.com/mvx10/engine.cgi?store=sdma");
if(strlen(cgi)>0) printf("&%s",cgi);
printf("\n\n");

return 0;
}//main

