using printf to redirect to web page

A

AileenRose

My program successfully executes with the exception of the last step of
redirecting to a web page.
The program is executed from a web page so after it is done with all of
its functions it should redirect to another page. All I get is a blank
screen.

printf( "Location: newWebPage\n\n\n");

If I duplicated this line, ie:
printf( "Location: newWebPage\n\n\n");
printf( "Location: newWebPage\n\n\n");

Then I get a page with "Location: newWebPage" displayed on it.

There is no useful information in my Apache log files. I'm at a loss
as to what I should do next.

Thanks for your help.
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

My program successfully executes with the exception of the last step of
redirecting to a web page.
The program is executed from a web page so after it is done with all of
its functions it should redirect to another page. All I get is a blank
screen.

What? Sorry but to me that does not make any sense at all, perhaps you
should provide some context, such as what your program is trying to do.
printf( "Location: newWebPage\n\n\n");

If I duplicated this line, ie:
printf( "Location: newWebPage\n\n\n");
printf( "Location: newWebPage\n\n\n");

This is pure C, not a shred of C++ in sight, perhaps you should try your
luck in comp.lang.c instead.
Then I get a page with "Location: newWebPage" displayed on it.

There is no useful information in my Apache log files. I'm at a loss
as to what I should do next.

In general, more than one or two lines of code is necessary for us to be
able to help you.
 
B

Bo Yang

AileenRose :
My program successfully executes with the exception of the last step of
redirecting to a web page.
The program is executed from a web page so after it is done with all of
its functions it should redirect to another page. All I get is a blank
screen.

printf( "Location: newWebPage\n\n\n");

If I duplicated this line, ie:
printf( "Location: newWebPage\n\n\n");
printf( "Location: newWebPage\n\n\n");

Then I get a page with "Location: newWebPage" displayed on it.

There is no useful information in my Apache log files. I'm at a loss
as to what I should do next.

Thanks for your help.
First, you post wrong group I think.
Your question is more relative with cgi programming but not c++.

I think it should be
printf("Location: newWebPage\r\n\r\n");
 
A

AileenRose

Thanks for 'listening'. I got it to work. I had some extra printf's
that I used for debugging.
Once I removed them, the page opened.

My apologies for knowing where to post this message.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top