Automatic page forwarding in cgi perl script

Discussion in 'Perl Misc' started by Max, Jul 1, 2003.

  1. Max

    Max Guest

    print ("Location: http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n");

    Why won't this work?
     
    Max, Jul 1, 2003
    #1
    1. Advertising

  2. (Max) wrote in
    news::

    > 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
     
    Eric J. Roode, Jul 2, 2003
    #2
    1. Advertising

  3. Jürgen Exner, Jul 2, 2003
    #3
  4. Max

    Max Guest

    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" <> wrote in message news:<Xns93ABB63653289asu1cornelledu@132.236.56.8>...
    > (Max) wrote in
    > news::
    >
    > > 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.
     
    Max, Jul 2, 2003
    #4
  5. Max

    Max Guest

    thanks, i am awed by your brillant logic by analogy.

    "Eric J. Roode" <> wrote in message news:<Xns93ABC301740D7sdn.comcast@206.127.4.25>...
    > (Max) wrote in
    > news::
    >
    > > 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?
     
    Max, Jul 2, 2003
    #5
  6. (Max) wrote in
    news::

    > "Jürgen Exner" <> wrote in message
    > news:<NRqMa.68$>...
    >> 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/ElectronicMedicalRecord/OrderEntry/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

    Remove dashes for address
    Spam bait: mailto:
     
    A. Sinan Unur, Jul 2, 2003
    #6
  7. Max

    Max Guest

    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" <> wrote in message news:<Xns93AC6BFDB7AE7asu1cornelledu@132.236.56.8>...
    > (Max) wrote in
    > news::
    >
    > > "Jürgen Exner" <> wrote in message
    > > news:<NRqMa.68$>...
    > >> 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/ElectronicMedicalRecord/OrderEntry/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.
     
    Max, Jul 2, 2003
    #7
  8. (Max) wrote in
    news::

    > "A. Sinan Unur" <> 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

    Remove dashes for address
    Spam bait: mailto:
     
    A. Sinan Unur, Jul 2, 2003
    #8
  9. In article <>,
    (Max) wrote:

    > "Jürgen Exner" <> wrote in message
    > news:<NRqMa.68$>...
    > > 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/ElectronicMedicalRecord/OrderEntry/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
     
    Michael Budash, Jul 3, 2003
    #9
  10. (Max) wrote in
    news::

    > 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_results.adp?query=localhost&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

    Remove dashes for address
    Spam bait: mailto:
     
    A. Sinan Unur, Jul 3, 2003
    #10
  11. Max

    Helgi Briem Guest

    On 3 Jul 2003 13:56:10 -0700, (Max) wrote:

    >I found out the problem. The
    >
    >print "Location: http://localhost/dir/dir/file";


    You have been warned many times about
    top-posting. Enough is enough.

    <plonk>
     
    Helgi Briem, Jul 4, 2003
    #11
  12. On Thu, Jul 10, Christian Accart yelled out atop a fullquote:

    > Try this:


    Aha, another triumph for top-posting...

    > print ("Location:
    > http:\/\/localhost\/ElectronicMedicalRecord\/OrderEntry\/Orders.html\n\n");


    It's a sure-fire bogosity indicator, isn't it, folks?

    I suppose you didn't learn anything from the previous postings on
    this thread. As such, it doesn't look as if Usenet is of any benefit
    to you; nor you to it.

    I'll be interested to see you prove me wrong. I'd welcome it, in
    fact, but I don't expect it'll happen.
     
    Alan J. Flavell, Jul 10, 2003
    #12
  13. Max

    Jacqui Caren Guest

    Re: Flavell's second law? Was: Automatic page forwarding in cgi perl script

    "Derek.Moody" <> wrote in news:ant110013e61BxcK@half-
    baked-idea.co.uk:

    >
    > Does this have sufficient status to become Flavell's second law?
    > Opinions?
    >


    Seconded :)

    Jacqui
     
    Jacqui Caren, Jul 15, 2003
    #13
    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. Navic
    Replies:
    2
    Views:
    2,619
  2. praba kar

    Python-cgi or Perl-cgi script doubt

    praba kar, Jul 30, 2005, in forum: Python
    Replies:
    1
    Views:
    710
    Michael Sparks
    Jul 30, 2005
  3. Andrew Tomazos
    Replies:
    5
    Views:
    600
  4. Replies:
    20
    Views:
    773
    Gunnar Hjalmarsson
    Jan 18, 2005
  5. kath
    Replies:
    4
    Views:
    701
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page