Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Automatic page forwarding in cgi perl script

Reply
Thread Tools

Automatic page forwarding in cgi perl script

 
 
Max
Guest
Posts: n/a
 
      07-01-2003
print ("Location: http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n");

Why won't this work?
 
Reply With Quote
 
 
 
 
Eric J. Roode
Guest
Posts: n/a
 
      07-01-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (Max) wrote in
news:(E-Mail Removed) m:

> print ("Location:
> http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n");
>
> Why won't this work?


My car is a blue '95 Subaru with four doors.

Why won't it start?

--
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      07-02-2003
Max wrote:
> print ("Location:
> http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n");
>
> Why won't this work?


Works just fine for me.
It prints the text
Location:
http://localhost/ElectronicMedicalRe...ry/Orders.html

to STDOUT. Did you expect it to do anything else?

jue


 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      07-02-2003
wanted to add that i am not expecting every user to have these files.
i am testing the pages on my machine only. i thought this was obvious
from the meaning of "localhost"



"A. Sinan Unur" <(E-Mail Removed)> wrote in message news:<Xns93ABB63653289asu1cornelledu@132.236.56.8> ...
> (E-Mail Removed) (Max) wrote in
> news:(E-Mail Removed) m:
>
> > print ("Location:
> > http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n");
> >
> > Why won't this work?

>
> Questions related to CGI but not Perl are better asked elsewhere, for
> example comp.infosystems.www.authoring.cgi.
>
> "Won't work" gives no information about the nature of your problem.
>
> Have you looked at the topic "A reference to another document" in section
> "How do I send my document back to the client?" available at:
>
> http://hoohoo.ncsa.uiuc.edu/cgi/primer.html
>
> What makes you think every user who runs this CGI program has a web
> server running, and also has the document
>
> /ElectronicMedicalRecord/OrderEntry/Orders.html
>
> exists on that machine?
>
> Sinan.

 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      07-02-2003
thanks, i am awed by your brillant logic by analogy.

"Eric J. Roode" <(E-Mail Removed)> wrote in message news:<Xns93ABC301740D7sdn.comcast@206.127.4.25>...
> (E-Mail Removed) (Max) wrote in
> news:(E-Mail Removed) m:
>
> > print ("Location:
> > http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n");
> >
> > Why won't this work?

>
> My car is a blue '95 Subaru with four doors.
>
> Why won't it start?

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      07-02-2003
(E-Mail Removed) (Max) wrote in
news:(E-Mail Removed) om:

> "Jürgen Exner" <(E-Mail Removed)> wrote in message
> news:<NRqMa.68$(E-Mail Removed)>...
>> Max wrote:
>> > print ("Location:
>> > http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n"
>> > );
>> >
>> > Why won't this work?

>>
>> Works just fine for me.
>> It prints the text
>> Location:
>> http://localhost/ElectronicMedicalRe...ry/Orders.html
>>
>> to STDOUT. Did you expect it to do anything else?

>
> wow, the sarcasm...
>
> what i want to do is forward to another page. i thought it was pretty
> obvious.


Nothing is obvious. You posted a line of code that does precisely what you
asked it to do (print the text you specified) without describing a lot of
pertinent details. You also posted to the wrong group ... From what I can
understand, your problems are due to the fact that you are not sending a
content type line. This is a CGI programming error, and has nothing to do
with Perl.

You can't get good answers without putting some effort into formulating
your question. The posting guidelines for this group might help learn how:

http://mail.augustmail.com/~tadmc/clpmisc.shtml

Sinan.


--
A. Sinan Unur
(E-Mail Removed)
Remove dashes for address
Spam bait: (E-Mail Removed)
 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      07-02-2003
Sinan,

That remark I wrote was intended towards a certain Jurgen Exner. I
read what you wrote in your message and I did post to the other group
as you advised. I appreciate the link you gave me, but it did not
solve the problem. My guess is that those who are making the sarcastic
remarks have some insight into the problem but rather than sharing
their knowledge as this forum is meant to be are just shooting their
smart mouths off. And the way the Usenet is set up it is not obvious
which groups are meant for what kind of material. Since nothing is
obvious.... This text is written in english. i'm on the third planet.
when you submit a response i will read it. and would appreciate a
reasonable response.

Respectfully,
Max

"A. Sinan Unur" <(E-Mail Removed)> wrote in message news:<Xns93AC6BFDB7AE7asu1cornelledu@132.236.56.8> ...
> (E-Mail Removed) (Max) wrote in
> news:(E-Mail Removed) om:
>
> > "Jürgen Exner" <(E-Mail Removed)> wrote in message
> > news:<NRqMa.68$(E-Mail Removed)>...
> >> Max wrote:
> >> > print ("Location:
> >> > http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n"
> >> > );
> >> >
> >> > Why won't this work?
> >>
> >> Works just fine for me.
> >> It prints the text
> >> Location:
> >> http://localhost/ElectronicMedicalRe...ry/Orders.html
> >>
> >> to STDOUT. Did you expect it to do anything else?

> >
> > wow, the sarcasm...
> >
> > what i want to do is forward to another page. i thought it was pretty
> > obvious.

>
> Nothing is obvious. You posted a line of code that does precisely what you
> asked it to do (print the text you specified) without describing a lot of
> pertinent details. You also posted to the wrong group ... From what I can
> understand, your problems are due to the fact that you are not sending a
> content type line. This is a CGI programming error, and has nothing to do
> with Perl.
>
> You can't get good answers without putting some effort into formulating
> your question. The posting guidelines for this group might help learn how:
>
> http://mail.augustmail.com/~tadmc/clpmisc.shtml
>
> Sinan.

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      07-02-2003
(E-Mail Removed) (Max) wrote in
news:(E-Mail Removed) om:

> "A. Sinan Unur" <(E-Mail Removed)> wrote in message
> news:<Xns93AC6BFDB7AE7asu1cornelledu@132.236.56.8> ...
>>
>> You can't get good answers without putting some effort into
>> formulating your question. The posting guidelines for this group
>> might help learn how:

....
> That remark I wrote was intended towards a certain Jurgen Exner. I
> read what you wrote in your message and I did post to the other group
> as you advised. I appreciate the link you gave me, but it did not
> solve the problem.


From http://hoohoo.ncsa.uiuc.edu/cgi/primer.html:

<blockquote>
If you want to reference another file (not protected by access
authentication) on your own server, you don't have to do nearly as much
work. Just output a partial (virtual) URL, such as the following:

Location: /dir1/dir2/myfile.html


The server will act as if the client had not requested your script, but
instead requested http://yourserver/dir1/dir2/myfile.html. It will take
care of most everything, such as looking up the file type and sending the
appropriate headers. Just be sure that you output the second blank line.
</blockquote>

Note the last sentence. Are you sure your code does that?

> My guess is that those who are making the sarcastic
> remarks have some insight into the problem but rather than sharing
> their knowledge as this forum is meant to be are just shooting their
> smart mouths off.


No one is supposed to try to guess the information you did not provide, and
you are suppose to do some of the work yourself. Since you have not given
any new information, it is hard to come up with new suggestions. Try and
give some context by providing a reasonable length script that exhibits the
problem.

Sinan.


--
A. Sinan Unur
(E-Mail Removed)
Remove dashes for address
Spam bait: (E-Mail Removed)
 
Reply With Quote
 
Michael Budash
Guest
Posts: n/a
 
      07-03-2003
In article <(E-Mail Removed)> ,
(E-Mail Removed) (Max) wrote:

> "Jürgen Exner" <(E-Mail Removed)> wrote in message
> news:<NRqMa.68$(E-Mail Removed)>...
> > Max wrote:
> > > print ("Location:
> > > http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n");
> > >
> > > Why won't this work?

> >
> > Works just fine for me.
> > It prints the text
> > Location:
> > http://localhost/ElectronicMedicalRe...ry/Orders.html
> >
> > to STDOUT. Did you expect it to do anything else?
> >
> > jue

>
> of course not... reading sometimes helps(like the subject line...) but
> i have to admit your wit is brillant. i wish i had it.
>


welcome to everyone's killfile...

--
Michael Budash
 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      07-03-2003
(E-Mail Removed) (Max) wrote in
news:(E-Mail Removed) om:

> Sinan,
>
> Thanks for your feedback.


For God's sake PLEASE stop top posting! If there is nothing of interest
in the post you are responding to, just delete everything before typing
anything.

> I tried using the path but it didn't work...
> my html directory is /var/www/html/dir1/dir2/file so I used
> /dir1/dir2/file. It just printed out the path. In my other posting,
> someone suggested using
>
> print "Content-type: text/html\n\n
>
> But something strange is happening now. I'm getting redirected to
>
> http://search.netscape.com/nscp_resu...st&source=NSCP
> Redirect


You mean to tell me that something like the example at:

http://www.unur.com/cgi-bin/redirect

is redirecting you to netscape.com?

Again, Apache configuration issues are beyond the scope of this group.
Bit by bit, you are giving details that might have been pertinent, but I
have neither the time nor the inclination after this to try to pull
information out of you.

> I deleted the Content-type and Location line and I'm still getting
> redirected...
>
> The line before this statement is
>
> while ($fetch->()) {print
> $res2->{LastName},$res2->{FirstName},$res2->{MiddleName},$res2->{DOB},$
> res2{SSN},"<BR>";


WTF?! How many times do you need to hear that the Location header needs
to be the first thing output from your script or else redirecting will
not work. The name might give you a clue: Header means something that is
at the head (beginning), you know?

> Basically I'm fetching some data from a database and redirecting to
> another html page.


That's not what you are doing. Is your script some kind of state secret
or something. This thread would have been long over and your problems
solved long ago if you had shown a reasonable length script.

> Help.


You are a troll.

> What is a killfile?


Somewhere I should have put you long time ago.

http://www.computerhope.com/jargon/k/killfile.htm

When people put you in their killfiles, they do not see your posts. That
means, they will not see your future questions, they will blissfully
avoid answering them.

Sinan.
--
A. Sinan Unur
(E-Mail Removed)
Remove dashes for address
Spam bait: (E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
forwarding Args&&... vs forwarding Args... Andrew Tomazos C++ 5 01-05-2012 11:15 PM
what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server? kath Perl Misc 4 04-09-2007 09:21 PM
Python-cgi or Perl-cgi script doubt praba kar Python 1 07-30-2005 08:25 AM
CGI: Execute a perl script inside another perl script xdarcos@hotmail.com Perl Misc 20 01-18-2005 12:33 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments