Solved

Call a HTML file from CGI with out using anchor reference

Posted on 2000-02-14
6
181 Views
Last Modified: 2010-03-05
I am using PERL with SQL Server database for creating a dynamic web pages and getting problem to call a HTML file from CGI script without using anchor reference i.e print <a href="http://localhost/gp/abc.htm" back</a>.
I dont want to click on back anchor and the abc.htm should be directly executed.Please provide a solution.

Thanks.
0
Comment
Question by:mon1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 3

Accepted Solution

by:
guadalupe earned 10 total points
ID: 2518671
I think this is what you want:

print "Location: http://www.domain.com\n\n";

!!!!!!!!!Carefull!!!!  If you have printed any other MIME type header like:

Content-type: text/html\n\n

The Location header will not work.  It must be the first thing you print to the browser.
0
 
LVL 3

Expert Comment

by:Raydot
ID: 2520772
Also keep in mind that the "\n\n" is vital, it won't work without it.  Would you happen to know why, Guadalupe?
0
 
LVL 3

Expert Comment

by:guadalupe
ID: 2522679
No, not exactly except that that is the format of MIME type headers.  For example:

Content-type: text/html\n\n

It must be to signal the end of the header so that what follows will not be confused as part of the header...

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:Raydot
ID: 2523049
Seems like a strange spec, and one that's hard to enforce given the way in which HTML is typically generated -- through an editor.  How does one generate the new lines then?  I guess it'll just be forever a mystery...
0
 
LVL 3

Expert Comment

by:guadalupe
ID: 2523207
Well, I'm not sure I agree with you...  The MIME header is not generated with and editor.  The mime type is generated by a Web server when it returns a document.  Since cgi are scripts we need to help the server by sending the MIME type header explicitly.  For example if you sent:

Content-type: image/gif\n\n

you could then stram out a gif.  This is how many counter programs work.
0
 
LVL 3

Expert Comment

by:guadalupe
ID: 2523212
Tha was supposed to be stream out a gif...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question