in reply to Re^3: joining string content
in thread joining string content
This is wat i tried, but not working because the receipts numbers have to be this way
my @recipients = ("+1234567890", "+1234567890");my $sender = $CGI->param("sender"); my $phone = $CGI->param("phonenumber"); # so am entering this way +1 +2344, +123344, +45454444 in textarea my $message = $CGI->param("message"); my $rep = ''; if ($sender) { my @raw_params = split /\s+/, $phone; my @quoted_params = map { qq{"$_"} } @raw_params; my $quoted_params_string = join ", ", @quoted_params; my @recipients = ($quoted_params_string); foreach my $recipient (@recipients) { my $req = HTTP::Request->new(POST => 'https://api.twilio.com/2010-04-0 +1/Accounts/AC5b68......756/Messages.json'); $req->content_type('application/x-www-form-urlencoded'); $req->authorization_basic("AC5b686.....56", "cd3.......d"); $req->content("To=$recipient&From=$sender&Body=$message"); my $response = $ua->request($req); if ($response->is_success) { $rep = "<p style='color: #29AB87;'>Messages Sent</p>"; } else { $rep = "<p style='color: #BF4F51;'>Nothing Sent</p>"; } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: joining string content
by Corion (Patriarch) on Jun 24, 2025 at 13:10 UTC | |
by joyfedl (Acolyte) on Jun 24, 2025 at 13:23 UTC | |
Re^5: joining string content
by tybalt89 (Monsignor) on Jun 24, 2025 at 15:09 UTC | |
by joyfedl (Acolyte) on Jun 24, 2025 at 15:14 UTC |