redirect problem

P

phal

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
 
G

Gunnar Hjalmarsson

phal said:
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.
 
B

Brian McCauley

Gunnar said:
Why do you start printing HTML if you want to redirect?



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.
 
A

Alan J. Flavell

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
 
A

Alan J. Flavell

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
 
M

Mark Clements

Brian said:
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
 
J

Jürgen Exner

phal said:
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
 
A

Alan J. Flavell

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.
 
M

Mark Clements

Alan said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top