单击Paypal按钮后的电子邮件表单

时间:2013-06-26 02:00:49

标签: php html forms email paypal

我正在为网站上的预订功能制作Paypal按钮。唯一的问题是Paypal每个表单只接受200个字符。任何额外的东西都没有结转。这是没有问题的,除了我希望我的访客能够给我一个预订的描述,可能会超过200个字符。

有没有办法可以:

1)通过Paypal发送超过200个字符(不要认为这是可能的)

2)点击按钮时发送包含此单一表格内容的电子邮件。

或者,如果你们中有任何人有另一种想法,我会全力以赴。如果你能为我做一些尽可能简单的事情,我会非常感激。我只知道HTML / CSS,但我认为这里需要PHP。如果你们中的任何人能够帮助我弄明白我也会很感激。如果表单是通过电子邮件发送的,则不需要通过Paypal发送,但是当用户单击立即购买按钮时,需要执行这两项操作。我怎么能做到这一点?

以下是表单代码:

    <form name="Booking" class="formoid-default" style="float:right;font-size:14px;font-family:'Open Sans','Helvetica Neue','Helvetica',Arial,Verdana,sans-serif;color:#666666;width:480px" onSubmit="return validateForm()" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="MPNJK99ZNT994">
<table>
<tr class="pay"><td><input type="hidden" name="on0"value="Package">Packages & Addons</td></tr><tr><td><select name="os0">
    <option value="Standard Rental">Standard Rental $199.00 USD</option>
    <option value="All In Special">All In Special $399.00 USD</option>
    <option value="Standard Rental + Custom Software Graphics">Standard Rental + Custom Software Graphics $149.00 USD</option>
    <option value="Standard Rental + Custom Frame Paint">Standard Rental + Custom Frame Paint $99.00 USD</option>
    <option value="Standard Rental + Custom Frame Decal">Standard Rental + Custom Frame Decal $99.00 USD</option>
    <option value="Reservation Date Deposit">Reservation Date Deposit $100.00 USD</option>
</select> </td>
 </tr>
<tr class="pay"><td><input type="hidden" name="on1" value="Contact Name"><strong>Reservation date deposit</strong> ensures that your unit will be reserved for your specific date and time (units are limited). Your deposit will go towards your remaining balance due upon delivery. Please give us a call if you have any questions about reservation date deposit.<hr style="height:0px; visibility:hidden;" />Contact Name*</tr></td><tr><td><input type="text" name="os1" maxlength="200"></td></tr>
<tr class="pay"><td><input type="hidden" name="on2" value="Contact Phone">Contact Phone*</td></tr><tr><td><input type="text" name="os2" maxlength="200"></td></tr>
<tr class="pay"><td><input type="hidden" name="on3" value="Address of event location">Address of event location*</td></tr><tr><td><input type="text" name="os3" maxlength="200"></td></tr>
<tr class="pay"><td><input type="hidden" name="on4" value="Start time for your rental">Start time for your rental*</td></tr><tr><td><input type="text" name="os4" maxlength="200"></td></tr>
<tr class="pay"><td><input type="hidden" name="on5" value="Date of event">Date of event*</td></tr><tr><td><input type="text" data-date-format="mm/dd/yy" id="dp2" name="os5" maxlength="200"></td></tr>
<tr class="pay"><td><input type="hidden" name="on6" value="Comments/Information">Comments/Information<br>Please provide us any information about the event. Theme, colors, name of person being celebrated, logo, etc. Keep in mind we use this information to design your custom software graphics and watermark. The more information the better.</td></tr><tr><td><textarea type="text" cols="20" rows="5" name="os6" maxlength="2000"></textarea></td></tr>
<tr class="pay"><td><input type="hidden" name="on7" value="How did you hear about us?">How did you hear about us?</td></tr><tr><td><input type="text" name="os7" maxlength="200"></td></tr>
</table><br>
<center>
<label for="disclaimer"> <input type="checkbox" name="agree" value="agree_terms" id="disclaimer" />&nbsp;I accept all <a style="color:#3387D4;" href="terms_of_use.html" target="_blank">terms of use</a></label>
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</center>
</form>

倒数第二个形式是我正在谈论的那个。正如您所看到的,我将它设置为2000的最大字符,但Papal只携带前200个.validifyForm()检查以确保检查所需的表单和使用条款,以防您想知道。

真的很感激任何输入。感谢您阅读/回复。

3 个答案:

答案 0 :(得分:1)

我更喜欢使用PHP脚本来处理和重定向到支付网关,包括PayPal。

您可以使用HTML表单向PayPal发送交易详情,而不是使用托管按钮。您还可以将POST请求发送到PayPal的服务器,并将详细信息作为发布数据,这是我首选的方法,因为这意味着business等变量不在客户端代码中且无法操作。

给出一个像这样的简单形式:

<form action="checkout.php" method="post">
  <input type="hidden" name="item_number" value="1" />
  <input type="hidden" name="item_name" value="My fabulous product" />
  <input type="submit" name="buy" />
</form>

您的 checkout.php 脚本可能如下所示:

<?php
if (isset($_POST['buy'])) {
    // merge other details PayPal needs
    $query_data = array(
        'amount' => 'COST OF ITEM',
        'business' => 'YOUR PAYPAL ADDRESS',
        'cmd' => '_xclick',
        'currency_code' => 'GBP',
        'item_number' => $_POST['item_number'],
        'item_name' => $_POST['item_name']
    );

    // redirect to PayPal
    header('Location: https://www.paypal.com/?' . http_build_query($query_data));
    exit;
}

这只是一个示例,但您应该了解情况。

在回答您的实际问题时,如果您采用上述方法,那么在结帐脚本中您可以执行任何操作。

一种方法是在数据库中创建订单记录(状态为“未付”)。这将为您提供一个订单ID,您可以将其作为custom参数传递给PayPal。同时,您还可以通过电子邮件发送$_POST['comments']的内容,但在重定向到PayPal之前,您需要捕获用户的电子邮件地址。

答案 1 :(得分:0)

您可以使用一个脚本向您发送包含数据的电子邮件,然后允许买方继续使用PayPal进行付款。但是,我要做的是让表单将信息写入数据库,然后为客户分配订单号/ ID等,以便在他们进行清算时转移到PayPal。然后,在付款完成后,您可以在系统上查找该订单ID,并查看买家输入的所有内容。

答案 2 :(得分:-1)

我遇到了这个问题。

我将两个200个字符的表单字段叠加在一起,并将第二个标记为“额外空格”。然后所有文本将从PayPal返回整洁并完成。流量没有任何问题减去一对夫妇。

相关问题