URL Redirection in CGI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kavin
    New Member
    • Nov 2006
    • 6

    URL Redirection in CGI

    Hi
    How to redirect to a url of a site's particular page.I had tried like this in my prog. Is it correct?

    Redirection url:
    http://www.gmail.com/login.cgi?LOGIN =abc&PASSWORD=1 23&domain=googl e.com&page=inbo x

    The problem that I am facing is that it takes gmail site but not using the parameters in the url(LOGIN=abc&P ASSWORD=123&dom ain=google.com& page=inbox).

    Any help will be greatly appreciable!!!! !!!!!!!
  • GunnarH
    New Member
    • Nov 2006
    • 83

    #2
    I don't think you have a redirection problem.

    There are Perl modules that might be useful to you: http://search.cpan.org/search?query=gmail

    Comment

    • kavin
      New Member
      • Nov 2006
      • 6

      #3
      Hi
      It is not a specific to gmail ,I would like to do it for general........ .I have used LWP::Simple module and its get() method......... .can you provide me a better solution for this issue.......... .......

      Comment

      • GunnarH
        New Member
        • Nov 2006
        • 83

        #4
        I haven't understood what "this issue" is. Make a better effort to explain what it is you want to accomplish. Also, post a short but complete script, that we can copy and run, and that demonstrates the problem you are having.

        Comment

        • geek491
          New Member
          • Oct 2006
          • 21

          #5
          Originally posted by kavin
          Hi
          How to redirect to a url of a site's particular page.I had tried like this in my prog. Is it correct?

          Redirection url:


          The problem that I am facing is that it takes gmail site but not using the parameters in the url(LOGIN=abc&P ASSWORD=123&dom ain=google.com& page=inbox).

          Any help will be greatly appreciable!!!! !!!!!!!

          Hi


          url redirection is very easy

          suppose u have a cgi program called home.pl which displays home page...but now u want the users to goto yahoo home page everytime they try to access the home.pl page.. to do this u need to change the code of home.pl to this


          [code=perl]
          #!c:\perl\bin\p erl

          use CGI;
          my $co = new CGI();

          $co->redirect('http ://www.yahoo.com') ;
          [/code]
          ############### ############### ######

          this will do the job for u.
          geek491
          Last edited by pbmods; Oct 12 '07, 11:24 PM. Reason: Added CODE tags.

          Comment

          • kavin
            New Member
            • Nov 2006
            • 6

            #6
            Hi
            Thanks for your suggestion..... .......

            But if I need my cgi script to redirect to the inbox page of my Yahoo mail(providing username and password in redirecting url), then what will be the solution??

            Comment

            • geek491
              New Member
              • Oct 2006
              • 21

              #7
              Originally posted by kavin
              Hi
              Thanks for your suggestion..... .......

              But if I need my cgi script to redirect to the inbox page of my Yahoo mail(providing username and password in redirecting url), then what will be the solution??
              unfortuanately yahoo encrypts the parameters before it sends it...so u cant use simple redirection like

              http://yahoomail.co.in/user=abc,passwo rd=abc

              it wont work... a session id which is created is unique and cant be replicated using url.

              Comment

              • lordspace
                New Member
                • Nov 2006
                • 10

                #8
                hi,

                browser uses HTTPS when sending user and password to google site and receives some auth cookies.

                about the redirection, here is my suggestion:

                [code=perl]
                #!/usr/bin/perl
                print "Location: http://domain.com\n\n" ;
                [/code]

                Svet
                Last edited by pbmods; Oct 12 '07, 11:24 PM. Reason: Fixed CODE tags.

                Comment

                Working...