Solved

Call a HTML file from CGI with out using anchor reference

Posted on 2000-02-14
6
185 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
Six Sigma Control Plans

630 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