Connecting Tech Pros Worldwide Help | Site Map

URL Redirection in CGI

  #1  
Old November 28th, 2006, 12:09 PM
Newbie
 
Join Date: Nov 2006
Posts: 3
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=123&domain=google.com &page=inbox

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

Any help will be greatly appreciable!!!!!!!!!!!
  #2  
Old November 28th, 2006, 03:20 PM
Member
 
Join Date: Nov 2006
Posts: 83

re: URL Redirection in CGI


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
  #3  
Old November 29th, 2006, 12:47 PM
Newbie
 
Join Date: Nov 2006
Posts: 3

re: URL Redirection in CGI


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.................
  #4  
Old November 29th, 2006, 01:09 PM
Member
 
Join Date: Nov 2006
Posts: 83

re: URL Redirection in CGI


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.
  #5  
Old December 6th, 2006, 08:15 AM
Newbie
 
Join Date: Oct 2006
Posts: 21

re: URL Redirection in CGI


Quote:
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:
http://www.gmail.com/login.cgi?LOGIN...com&page=inbox

The problem that I am facing is that it takes gmail site but not using the parameters in the url(LOGIN=abc&PASSWORD=123&domain=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


Expand|Select|Wrap|Line Numbers
  1. #!c:\perl\bin\perl
  2.  
  3. use CGI;
  4. my $co = new CGI();
  5.  
  6. $co->redirect('http://www.yahoo.com');
  7.  
####################################

this will do the job for u.
geek491

Last edited by pbmods; October 13th, 2007 at 12:24 AM. Reason: Added CODE tags.
  #6  
Old December 7th, 2006, 04:29 AM
Newbie
 
Join Date: Nov 2006
Posts: 3

re: URL Redirection in CGI


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??
  #7  
Old December 20th, 2006, 09:35 AM
Newbie
 
Join Date: Oct 2006
Posts: 21

re: URL Redirection in CGI


Quote:
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,password=abc

it wont work... a session id which is created is unique and cant be replicated using url.
  #8  
Old December 27th, 2006, 11:44 AM
Newbie
 
Join Date: Nov 2006
Location: Bulgaria
Posts: 10

re: URL Redirection in CGI


hi,

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

about the redirection, here is my suggestion:

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. print "Location: http://domain.com\n\n";
  3.  
Svet

Last edited by pbmods; October 13th, 2007 at 12:24 AM. Reason: Fixed CODE tags.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
redirect.php maligns redirection URL every time comp.lang.php answers 1 October 28th, 2006 02:45 AM
apache php cgi install problem Joseph S. answers 3 February 22nd, 2006 07:25 PM
Form submit button not working with URL redirection Hongyu answers 2 August 9th, 2005 09:35 AM