Hi, I updated my script, but now some of the variables are not accessible like item_number here is the code
#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp 'fatalsToBrowser'; use LWP::UserAgent; use Email::Sender::Simple qw(sendmail); use Email::Sender::Transport::SMTPS (); use Email::Simple (); use Email::Simple::Creator (); my $smtpserver = 'smtp.gmail.com'; my $smtpport = '587'; my $smtpuser = 'alexjaquet@gmail.com'; my $smtppassword = ''; my $transport = Email::Sender::Transport::SMTPS->new({ host => $smtpserver, port => $smtpport, ssl => "starttls", sasl_username => $smtpuser, sasl_password => $smtppassword, }); my $q = CGI->new(); my $query = 'cmd=_notify-validate;'.$q->query_string; $query =~ s/;/&/g; my $PP_server = 'ipnpb.sandbox.paypal.com'; # sandbox IP:173.0.82.66 my $url = 'https://'.$PP_server.'/cgi-bin/webscr'; my $ua = LWP::UserAgent->new( ssl_opts => { keep_alive => 1, verify_hostname => 1, SSL_version => 'SSLv23:!TLSv12', } ); my $req = HTTP::Request->new('POST',$url); $req->content_type('application/x-www-form-urlencoded'); $req->header(Host => $PP_server); $req->content($query); my $msg; my $res = $ua->request($req); # make the variable hash my %variable = map { split(m'='x, $_, 2) } grep { m'='x } split(m'&'x, $query); # assign posted variables to local variables my $item_name = $variable{'item_name_1'}; my $item_number = $variable{'item_number'}; my $item_number_1 = $variable{'item_number_1'}; my $payment_status = $variable{'payment_status'}; my $payment_amount = $variable{'mc_gross'}; my $payment_currency = $variable{'mc_currency'}; my $txn_id = $variable{'txn_id'}; my $receiver_email = $variable{'receiver_email'}; my $payer_email = $variable{'payer_email'}; if ($res->is_success) { $msg = "SUCCESS : ".$res->decoded_content; if ($res->decoded_content eq 'VERIFIED') { my $email = Email::Simple->create( header => [ To => 'alexjaquet@gmail.com', From => 'robot@avant-garde.info', Subject => "Payement recu d une publicite p +ar :".$payer_email , ], body => $msg." TX ID : ".$txn_id. " ITEM NUMBER : ".$item +_number . " ITEM NUMBER_1 : ".$item_number_1 ."RECEIVER_EMAIL : ".$r +eceiver_email,); sendmail($email, { transport => $transport }); } } else { $msg = "ERROR : ".$res->status_line; my $email = Email::Simple->create( header => [ To => 'alexjaquet@gmail.com', From => 'robot@avant-garde.info', Subject => 'Erreur dans le payement d une p +ublicite', ], body => $msg,); sendmail($email, { transport => $transport }); }
My html page looks like the Following
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w +3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Supermarket</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1 +" /> <link href="/css/main.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="conteneur"> <br /> <br/> <div class="centre"> <br/> <form method='POST' action='https://www.sandbox.paypal.com/cgi-bin +/webscr'> <input type='hidden' name='cmd' value='_cart'> <input type='hidden' name='upload' value='1'> <input type='hidden' name='business' value='alexjaquet@gmail.com'> <input type='hidden' name='bn' value='OnlineStore_Cart_WPS'> <input type='hidden' name='lc' value='CH'> <input type='hidden' name='currency_code' value='CHF'> <input type='hidden' name='no_note' value='1'> <input type='hidden' name='no_shipping' value='2'> <input type='hidden' name='quantity_1' value='1'> <input type='hidden' name='item_number_1' value='$ARTICLE{'id_article' +}'> <input type='hidden' name='item_name_1' value='$ARTICLE{'name'}'> <input type='hidden' name='amount_1' value='50.00'> <input type="hidden" name='notify_url' value='http://avant-garde.info/ +cgi-bin/ipn.pl'> <input type='submit' style='font-family:Arial;' value='Secure Order Fo +rm' name='submit3'> </form> </td></tr></table></BODY> </HTML>
And my email response is the Following : SUCCESS : VERIFIED TX ID : 4AJ83296LX592004J ITEM NUMBER : ITEM NUMBER_1 : RECEIVER_EMAIL : alexjaquet%40gmail.com

In reply to Re^4: PayPal IPN Script End of script output before headers: by *alexandre*
in thread PayPal IPN Script End of script output before headers: by *alexandre*

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.