Solved

Call a HTML file from CGI with out using anchor reference

Posted on 2000-02-14
6
176 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
  • 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

785 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