Is this correct ?


sub tcy{
print "Content-type: text/html\n\n";
print "<script language=\"JavaScript\">";
print "\"\");";
print " </script>";

It doesn't give me anything. Why ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It works just fine. Any minimized windows on your desktop? Check them.
By the way, why not use perl?

use CGI ':standard';
$url = param("url");  

if ($url) {
    print redirect(-URL=>"$url", -TARGET=>"_new");

I agree, use perl.  Make it easier though than malec:


print "Location:\n\n";

That's all you need.
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

tanc02Author Commented:
sorry ! Forget to tell you guys, I wnat to include
width and height and no toolbar in the can you experts show me how to do it in perl by using javascript ?
Try this. This will set the width and height and you can also
choose what toolbars and scrollbars to show.

This is the javascript function. Put it somewhere on the top of the html:
<script language="javascript">

function popup(document) {
  var floater = null
  floater ='','popup','width=254,height=381,resizable=1,status=0,scrollbars=0')
  if (floater != null) {
    if (floater.opener == null) {
      floater.opener = self
    floater.location.href = document
// -->

This is how the link should look like:
<a href="javascript:popup('doc.html')">

There is also a problem in Internet Explorer 3.0. You have to
write the full path for link if you want to work it in Internet
Explorer 3.

tanc02Author Commented:
I don't what a link. I want this javascript to be written into PERL script, since PERL must return something after completeing request.

Let has a CGI MailForm, and after user
hit submit button, and mail request is completed, then send(javascript) to open a new window with
width=200 and height =100 and no toolbar
marko changed the proposed answer to a comment
Use the code I gave in the new HTML which is printed out
by cgi-bin program to open the new window. If you delete
the lines which define this code to be the function the
code will be executed when HTML is loaded. Or put this
function in onLoad handler in html returned by cgi-bin.
tanc02Author Commented:
i tried it, i didn't see anything
try this........

in addition to doing what you need, this program also centers the newly open windows!!


use CGI;

$query=new CGI;

print "Content-type: text/html\n\n";
if ($query->param){      ##      The form has been submitted by user
      $text_message=$query->param('text_message');      ##      Read the CGI data
      print "Content-type: text/html\n\n";
      print qq{
            function open_win(){
                  var winWidth = screen.width;
                  var winHeight = screen.height;

                  userWindow.moveTo((winWidth - 600)/2, (winHeight - 650)/2);
                  return false;
            <body onLoad="open_win();">

      print "<P><B>The form data was received by the CGI script<BR>\n";
      print "<B>You entered $text_message</b>\n";

      print "<FORM ACTION=\"".$ENV{SCRIPT_NAME}."\"METHOD=POST>\n";
      print "Enter anything in the text box: <INPUT TYPE=TEXT NAME=text_message VALUE=\"\">\n";
      print "<P><INPUT TYPE=SUBMIT VALUE=\"Submit Now!!\">\n";
      print "</FORM>\n";

tanc02Author Commented:
Is that possible to open up another window without changing the web site ?

Like A.html is a CGI MAILFORM, and it is written
in html, then call a cgi script to send the mail.

Then after user pressed the button, the mail will be sent, but it open an window to confirm that
mail is sent successfully without changing the A.html. If yes, how ?
This is not possible. If you have "submit" button in your
form you have to change the HTML. You can always load
the same HTML document, but you have to change it.

the code seems to be absolutely fine.

please check whether perl exists in the path you have specified in the first line.

hope it help

- amit
tanc02Author Commented:
points will divided into 25 for marko and 25
for maneshr. Tell me how ?

I am answering this question so it can be saved as a PAQ. I am issueing 25 point questions for the experts named in this question, who will find thir questions in this topic area.

Community Support @ Experts Exchange

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.