perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From K Broc Seib <bs...@icd.ics.purdue.edu>
Subject Re: Response->Redirect
Date Fri, 01 Nov 2002 16:39:42 GMT
Hi Raghu,

Two things:

(1) On passing args on a Redirect: I have had no problem passing
them on as part of the url, like

  $params = {
    'name' => 'Fred',
    'wife' => 'Wilma',
  }
  $url = '/server/relative/path/script.pl'; ## or could be "http://blahblah/x"

  $full_url = $Server->URL($url,$params);
  $Response->Redirect($full_url);


You may also need $Server->URLEncode() depending on if you have odd
characters, like spaces, in your $param structure's keys or values.

In addition, if you are passing around args from script to script
that need to be preserved, you may have to pre-fill your $param struct
using $Request->Params() and add/delete keys you need or don't want.

Checkout apache-asp docs for:

  $Server->URL($url, \%params)
  $Server->URLEncode($string)
  $Request->Params()



(2) Is your goal to have dynamic image appear within your pages? In
that case, you should just include your image like it is any other
image in your html document, but make the image's url point to your
code, e.g.

  <img src="/path/to/your/script/make_png_image.pl">

Then have your script 'make_png_image.pl' return the proper MIME type
to your browser, perhaps 'image/png'. E.g.,

  my $im = new GD::Image(10,10);
  ## do the drawing with $im

  $Response->{ContentType} = 'image/png';  ## read about these
  $Response->BinaryWrite($im->png);        ## read about these

That's it in general; I didn't test any of that code, but that should
convey the concept and point you toward the right routines to read
about in the docs.

Hope that helps.

-broc



 > Hi All ,
 > 
 >          As i have been having problems with GD:Graph in Apache::Asp , I =
 > am generating the GD using a perl scripts and hence want to call the =
 > perlscripts like
 > 
 > $Response->Redirect("http:\\testcmp:8080\scripts\gd.pl") , wanted to =
 > know if we could pass @args like Response->Include for passing CGi Query =
 > Paramters instead of constructing the Query Parameters like =
 > gd,pl?Start=3D"Yes"+End=3D"No".
 > 
 > 
 > Thanks
 > 
 > Raghu

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message