in reply to Re^3: Post Email address as CGI Parameter
in thread Post Email address as CGI Parameter

Thank you for your inputs. However, I have nearly 10+ fields to be sent and I don't think it makes any sense to send it via URL. Here is the code I'm working on....

#!/usr/bin/perl use strict; use HTTP::Request::Common; use CGI; use Facebook::Graph; use Data::Dumper; my $APP_ID = 'SOME_ID'; my $SECRET = 'SOME_SECRET_CODE'; my $POSTBACK_URL = "http://goto.this.domain/postback.pl"; my $fb = Facebook::Graph->new( app_id => $APP_ID, secret => $SECRET, postback => $POSTBACK_URL, ); my $q = new CGI; my $params = $q->Vars; my $code = $params->{'code'}; $fb->request_access_token($code); my $token = $fb->access_token; $fb->request_extended_access_token($token); my $user = $fb->fetch('me'); #register the facebook data into my site to create a new profile; my $login = $user->{'name'}; $login =~ s/\s//g; my $sarah_bownds = $fb->query->find($user->{'id'}) ->select_fields(qw(id name email)) ->request ->as_hashref; my $default_picture = $fb->picture($user->{'id'})->get_square->uri_as +_string; my %register = ( login => $login, firstname => $user->{'first_name'}, lastname => $user->{'last_name'}, email => $user->{'email'}, action => 'register', id => $user->{'id'}, ); print $q->redirect("http://goto.this.domain/cgi/register.cgi?login=$lo +gin&id=$user->{'id'}&email=$user->{'email'}&msg=201&args=$sarah_bownd +s");

Replies are listed 'Best First'.
Re^5: Post Email address as CGI Parameter
by Anonymous Monk on Jan 07, 2015 at 08:52 UTC
Re^5: Post Email address as CGI Parameter
by soonix (Chancellor) on Jan 07, 2015 at 09:03 UTC
    I don't know what my $sarah_bownds = $fb-> ... ->as_hashref is supposed to return, but if it is a hashref, I wouldn't put it into an URL like you did.
    First step to verify this would be to change the last line of your code to
    my $gotourl = "http://goto.this.domain/cgi/register.cgi?login=$login&i +d=$user->{'id'}&email=$user->{'email'}&msg=201&args=$sarah_bownds"; print "going to >>>$gotourl<<<\n"; print $q->redirect($gotourl);