Solved

Call a HTML file from CGI with out using anchor reference

Posted on 2000-02-14
6
173 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 3

Expert Comment

by:Raydot
Comment Utility
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
Comment Utility
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
Comment Utility
Tha was supposed to be stream out a gif...
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now