or do i need to change any any setting in paypal site to activate notify_url
Here is my html code for the form
================================================
Expand|Select|Wrap|Line Numbers
- <input type="Hidden" name="cmd" value="_xclick">
- <input type="Hidden" name="business" value="username@hotmail.com">
- <!-- Allow customer to enter desired quantity -->
- <input type="Hidden" name="undefined_quantity" value="1">
- <input type="Hidden" name="item_name" value="Registraion">
- <input type="Hidden" name="item_number" value="">
- <!-- No currency_code variable has been specified, so monetary amount is assumed to be USD -->
- <input type="Hidden" name="amount" value="10">
- <! Passthrough variables for order tracking or other purpose -->
- <input type="Hidden" name="custom" value="">
- <input type="Hidden" name="invoice" value="">
- <input type="Hidden" name="charset" value="">
- <input type="Hidden" name="no_shipping" value="1">
- <input type="Hidden" name="return" value="">
- <input type="Hidden" name="cancel_return" value="">
- <!-- Do not prompt customer to include a note with the purchase -->
- <input type="Hidden" name="no_note" value="1">
- <input type="Hidden" name="rm" value="2">
- <input type="Hidden" name="notify_url" value="">
- <input id=UserName style="WIDTH: 165px" tabindex=1 maxlength=16 name="Name">
- <input id=PasswordVerify style="WIDTH: 165px" tabindex=3 type=text maxlength=15 name="Phone">
- <input id=EMail style="WIDTH: 165px" tabindex=4 name="Email">
- <input type=submit value=Submit Now name=Authorize onClick="updatevaluesonsubmit()">
- <script language="JavaScript" type="text/JavaScript">
- function updatevaluesonsubmit()
- notify_url = "http://mysite.com/Payment-Complete.php?";
- notify_url = notify_url + "Name=" + frm.Name.value;
- notify_url = notify_url + "&Phone=" + frm.Phone.value;
- notify_url = notify_url + "&Email=" + frm.Email.value;
- notify_url = notify_url + "&Country=" + frm.Country.value;
- notify_url = notify_url + "&Product=" + frm.Registraion.value;
- notify_url = notify_url + "&Amount=" + frm.amount.value;
- frm.notify_url.value = notify_url;
- </Script>
When user clicks on submit I am running updatevaluesonsubmit javascript to update notify_url field (I checked this and it works fine)
then it opens paypal site but when user makes payment it does not run Payment-Complete.php.
here is the code of Payment-Complete.php to send email. but it does not send email
================================================== ====
Payment-Complete.php:
Expand|Select|Wrap|Line Numbers
- <?php
- // multiple recipients
- $to = '__MUNGED__'; //
- $companyname = 'My comany';
- //Put name of cc. put " $cc = '' " if not required
- $cc = '__MUNGED__';
- //Put name of bcc. put " $bcc = '' " if not required
- $bcc = '';
- // subject
- $subject = 'Payment Complete';
- // message
- $mailBody = '';
- $mailBody = $mailBody . '
- <table border="0" bordercolor="#000000" rowheight="30" width="400" cellspacing="1" celpadding="1">
- <tr>
- <td align="center" bgcolor="#CCCCCC" colspan="2" height="30"><b>
- <font face="Arial" size="2">Personal Details</font></b></td></tr>';
- $mailBody = $mailBody . '<tr>
- <td align="right" bgcolor="#CCCCCC" height="30"><font face="Arial" size="2">Name : </td>
- <td bgcolor="#EAEAEA"><font face="Arial" size="2">';
- $mailBody = $mailBody . $_REQUEST['Name']."</td></tr>";
- $mailBody = $mailBody . '<tr>
- <td align="right" bgcolor="#CCCCCC" height="30"><font face="Arial" size="2">Email : </td>
- <td bgcolor="#EAEAEA"><font face="Arial" size="2">';
- $mailBody = $mailBody . $_REQUEST['Email']."</td></tr>";
- $mailBody = $mailBody . '<tr>
- <td align="right" bgcolor="#CCCCCC" height="30"><font face="Arial" size="2">Phone : </td>
- <td bgcolor="#EAEAEA"><font face="Arial" size="2">';
- $mailBody = $mailBody . $_REQUEST['Phone']."</td></tr>";
- $mailBody = $mailBody . '<tr>
- <td align="right" bgcolor="#CCCCCC" height="30"><font face="Arial" size="2">Product : </td>
- <td bgcolor="#EAEAEA"><font face="Arial" size="2">';
- $mailBody = $mailBody . $_REQUEST['Product']."</td></tr>";
- $mailBody = $mailBody . '<tr>
- <td align="right" bgcolor="#CCCCCC" height="30"><font face="Arial" size="2">Amount : </td>
- <td bgcolor="#EAEAEA"><font face="Arial" size="2">';
- $mailBody = $mailBody . $_REQUEST['Amount']."</td></tr>";
- $mailBody = $mailBody . '<tr>
- <td align="right" bgcolor="#CCCCCC" height="30"><font face="Arial" size="2">Country : </td>
- <td bgcolor="#EAEAEA"><font face="Arial" size="2">';
- $mailBody = $mailBody . $_REQUEST['Country'].'</td></tr></table><BR><BR>';
- $mailBody = $mailBody .'<font face="Arial" size="2">Thank you, <br><br>';
- $mailBody = $mailBody .'from<b> ' . 'ABC.com' . '</b><br><br><br></font>';
- $headers = '';
- // To send HTML mail, the Content-type header must be set
- //$headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- // Additional headers
- $headers .= 'To: ' . $companyname . '<' . $to . '>' . "\r\n";
- $headers .= 'From: '.$_REQUEST['Name'].' <'.$_REQUEST['Email'].'>' . "\r\n";
- if ($cc!='')
- {
- $headers .= 'Cc:' . trim($cc) ."\r\n";
- }
- if ($bcc!='')
- {
- $headers .= 'Bcc: ' . trim($bcc) . "\r\n";
- }
- // Mail it
- mail($to, $subject, $mailBody, $headers);
- //Open thank you page
- //include("thank-you.htm");
- ?>
Please help!!
Thanks,
Yogesh