redirect problem

Discussion in 'Perl Misc' started by phal, Sep 12, 2005.

  1. phal

    phal Guest

    hi, everyone

    I want to redirect inside the header(),and start_html()
    as I know this type of redirect will not work, anyone know how to
    redirect inside start_html().

    More, any link to tutorial related to perl session.

    Thank very much for your time
    phal, Sep 12, 2005
    #1
    1. Advertising

  2. phal wrote:
    > I want to redirect inside the header(),and start_html()
    > as I know this type of redirect will not work,


    Why do you start printing HTML if you want to redirect?

    > anyone know how to redirect inside start_html().


    No. It can't be done.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Sep 12, 2005
    #2
    1. Advertising

  3. Gunnar Hjalmarsson wrote:
    > phal wrote:
    >
    >> I want to redirect inside the header(),and start_html()
    >> as I know this type of redirect will not work,

    >
    >
    > Why do you start printing HTML if you want to redirect?
    >
    >> anyone know how to redirect inside start_html().

    >
    >
    > No. It can't be done.


    Well, you could emit embedded client-side scripting (Javascript) in the
    HTML to perform a redirect on clients that have Javascript support enabled.

    How to do this and why it's probably a bad idea have nothing to do with
    Perl.
    Brian McCauley, Sep 12, 2005
    #3
  4. On Mon, 11 Sep 2005, phal wrote:

    > I want to redirect inside the header(),and start_html()
    > as I know this type of redirect will not work, anyone know how to
    > redirect inside start_html().


    Redirect is an FAQ. I'd recommend this version of faq9:
    http://faq.perl.org/perlfaq9.html#How_do_I_redirect_to

    Redirection (in this technical sense) has to be done before
    start_html()

    Why do you think you want to do it from start_html() ? - what are
    you hoping to achieve, in real-world terms?

    > More, any link to tutorial related to perl session.


    What do you mean by "session", and particularly by "perl session"?
    HTTP is inherently stateless. Perhaps if you'd show more detail of
    what you really intend, you could get a clearer answer.

    good luck
    Alan J. Flavell, Sep 12, 2005
    #4
  5. On Mon, 12 Sep 2005, Brian McCauley wrote:

    > Gunnar Hjalmarsson wrote:
    > > phal wrote:
    > >
    > > > I want to redirect inside the header(),and start_html()
    > > > as I know this type of redirect will not work,

    > >
    > > Why do you start printing HTML if you want to redirect?
    > >
    > > > anyone know how to redirect inside start_html().

    > >
    > > No. It can't be done.

    >
    > Well, you could emit embedded client-side scripting (Javascript) in
    > the HTML to perform a redirect on clients that have Javascript
    > support enabled.


    which might be described as "redirect" in everyday language, but
    should not be confused with a proper redirection transaction in the
    technical sense, since the content of the first object would need to
    be retrieved and evaluated ("rendered", as the saying goes), [and the
    vital parts disregarded by those security-aware users who protect
    themselves against unexpected javascript], before anything further
    could happen.

    > How to do this and why it's probably a bad idea have nothing to do
    > with Perl.


    Quite so, but I couldn't resist a comment from the sidelines, sorry.
    And I'd put it as more than "probably" a bad idea - and not only
    because it would violate the WAI guidelines.

    And the same goes for the other, as yet unspoken, suggestion for an
    ersatz redirect (which would be equally OT, so I'll stop there,
    unless I feel myself provoked further :-} ).

    All the best
    Alan J. Flavell, Sep 12, 2005
    #5
  6. Brian McCauley wrote:
    > Gunnar Hjalmarsson wrote:
    >
    >> phal wrote:
    >>
    >>> I want to redirect inside the header(),and start_html()
    >>> as I know this type of redirect will not work,

    >>
    >>
    >>
    >> Why do you start printing HTML if you want to redirect?
    >>
    >>> anyone know how to redirect inside start_html().

    >>
    >>
    >>
    >> No. It can't be done.

    >
    >
    > Well, you could emit embedded client-side scripting (Javascript) in the
    > HTML to perform a redirect on clients that have Javascript support enabled.
    >
    > How to do this and why it's probably a bad idea have nothing to do with
    > Perl.
    >


    <META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html">

    in the <HEAD> section should do it.

    mark
    Mark Clements, Sep 12, 2005
    #6
  7. On Mon, 12 Sep 2005, Mark Clements wrote:

    > <META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html">
    >
    > in the <HEAD> section should do it.


    Oh dear. I suppose it was inevitable. Can't you read?
    Redirect is not "refresh".


    [f'up set]
    Alan J. Flavell, Sep 12, 2005
    #7
  8. Alan J. Flavell wrote:
    > On Mon, 12 Sep 2005, Mark Clements wrote:
    >
    >
    >><META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html">
    >>
    >>in the <HEAD> section should do it.

    >
    >
    > Oh dear. I suppose it was inevitable. Can't you read?
    > Redirect is not "refresh".


    That is just rude: plain and simple, whatever the technical accuracy of
    my suggestion.

    >
    >
    > [f'up set]

    Indeed.

    Mark
    Mark Clements, Sep 12, 2005
    #8
  9. phal

    phal Guest

    Okay, whatsoever, it is an interesting respond.
    Thank
    phal, Sep 13, 2005
    #9
  10. phal wrote:
    > Okay, whatsoever, it is an interesting respond.


    What is an interesting response?
    Please quote an appropriate amount of text -as has been proven practice for
    the last two decades- such that other people have a chance to know what you
    are talking about.

    jue
    Jürgen Exner, Sep 13, 2005
    #10
  11. On Mon, 12 Sep 2005, Mark Clements wrote:

    > Alan J. Flavell wrote:
    > >
    > > Oh dear. I suppose it was inevitable. Can't you read? Redirect
    > > is not "refresh".

    >
    > That is just rude:


    It's rude to post misleading answers, in an off-topic situation such
    that those who know a good answer (which had already been posted by
    others, after all) feel inhibited from posting a comprehensive
    refutation. Any resulting perceived rudeness is at least partly the
    responsibility of the one who provoked it.

    It risks that readers who don't know better will take the bad answer
    which they like the look of, rather than the proper answer which they
    ought to be using.

    Anyone reading this would be better advised, if they want a proper
    answer rather than a misleading hack, to go to the
    comp.infosystems.www.* hierarchy, or to authoritative sources, for
    better advice on the topic.

    Apologies to the denizens of c.l.p.misc for the noise level: but this
    is just one specific instance of the general problem, so I dare to
    suggest it's worth including this reminder about the increased
    unreliability of off-topic answers, and advice to treat them as no
    more than potentially misleading clues, to be verified from more
    reliable sources.
    Alan J. Flavell, Sep 13, 2005
    #11
  12. Alan J. Flavell wrote:
    > On Mon, 12 Sep 2005, Mark Clements wrote:
    >
    >
    >>Alan J. Flavell wrote:
    >>
    >>>Oh dear. I suppose it was inevitable. Can't you read? Redirect
    >>>is not "refresh".

    >>
    >>That is just rude:

    >
    >
    > It's rude to post misleading answers, in an off-topic situation such
    > that those who know a good answer (which had already been posted by
    > others, after all) feel inhibited from posting a comprehensive
    > refutation. Any resulting perceived rudeness is at least partly the
    > responsibility of the one who provoked it.


    At the time, I thought my answer was reasonable, and didn't think it too
    different to Brian's solution. I had not yet seen your comprehensive
    response - there is only one minute's difference in posting times. I did
    not realise that http-equiv refresh was generally considered a red-flag
    issue, despite having used it occasionally over the years.

    My apologies for not properly explaining my suggestion, but I maintain
    that your aggression was uncalled for.

    Mark
    Mark Clements, Sep 13, 2005
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bagsmode
    Replies:
    2
    Views:
    5,471
    bagsmode
    Jul 28, 2003
  2. Jay
    Replies:
    2
    Views:
    336
    Hermit Dave
    Jan 26, 2004
  3. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,221
    Srowe1975
    Oct 15, 2008
  4. Sal
    Replies:
    1
    Views:
    380
  5. Ron Howard
    Replies:
    2
    Views:
    509
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page