The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call to undefined function?
I'm a bit confused... I'm trying to implement the Paypal tutorial found here: into my site, yet when I try to add this function
$fields = ft_api_init_form_page(2, "initialize");
I get this error
Fatal error: Call to undefined function ft_api_init_form_page() in /home3/researd7/public_html/donate/index.php on line 3

What am I doing wrong? I've put all the information in the top of the file like it says in the documentation.
$fields = ft_api_init_form_page("", "test");
$params = array(
  "submit_button" => "submit_button_name_attribute",
  "next_page" => "thanks.php",
  "form_data" => $_POST,
  "file_data" => $_FILES,
  "finalize" => true

Here's what my page looks like. I'm trying to get it to work before I actually modify the content.

$fields = ft_api_init_form_page(2, "initialize");
$params = array(
  "submit_button" => "submit-button",
  "next_page" => "success.php",
  "form_data" => $_POST,
  "finalize" => true
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>Form Tools - Donate</title>
  <script type="text/javascript" src="includes/validation.js"></script>
  <link rel="stylesheet" type="text/css" href="includes/main.css">

<script type="text/javascript">

var rules = new Array();
rules.push("required,firstname,Please enter your first name.");
rules.push("required,lastname,Please enter your last name.");
rules.push("required,email,Please enter your email address.");



// this sets the default country
$page = array();
$page['country'] = "United States";

  <div class="title">Donate</div>

    Any donations to help keep the Form Tools project going are greatly appreciated! Just
    use the form below to donate by PayPal or credit card.

  <form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" onsubmit="return validateFields(this, rules)">

    <!-- *** These two values will need to be changed for your form! *** -->
    <input type="hidden" name="item_name" value="Form Tools" />
    <input type="hidden" name="form_tools_form_id" value="2" />

    <table border="0" cellspacing="1">
      <td width="10" class="red">*</td>
      <td width="110">First Name</td>
      <td width="10"> </td>
      <td><input type="text" name="firstname" /></td>
      <td class="red">*</td>
      <td>Last Name</td>
      <td> </td>
      <td><input type="text" name="lastname" /></td>
      <td class="red">*</td>
      <td>Email Address</td>
      <td> </td>
      <td><input type="text" name="email" style="width: 200px;" /></td>
      <td class="red"> </td>
      <td> </td>
      <td><input type="text" name="city" /></td>
      <td class="red">*</td>
      <td align="right"><b>$</b></td>
        <select name="amount">
          <option value="2">2</option>
          <option value="5">5</option>
          <option value="10">10</option>
          <option value="20" selected>20</option>
          <option value="30">30</option>
          <option value="40">40</option>
          <option value="50">50</option>
          <option value="100">100</option>
          <option value="150">150</option>
          <option value="200">200</option>
          <option value="250">250</option>
        </select> (Canadian)
      <td class="red"> </td>
      <td> </td>
        <select name="country">
          <option <?php if ($page['country'] == "") echo "selected"; ?> value="">Select Country</option>
          <option  <?php if ($page['country'] == "Afghanistan") echo "selected"; ?> value="Afghanistan">Afghanistan</option>
          <option  <?php if ($page['country'] == "Albania") echo "selected"; ?> value="Albania">Albania</option>
          <option  <?php if ($page['country'] == "Algeria") echo "selected"; ?> value="Algeria">Algeria</option>
          <option  <?php if ($page['country'] == "American Samoa") echo "selected"; ?> value="American Samoa">American Samoa</option>
          <option  <?php if ($page['country'] == "Andorra") echo "selected"; ?> value="Andorra">Andorra</option>
          <option  <?php if ($page['country'] == "Angola") echo "selected"; ?> value="Angola">Angola</option>
          <option  <?php if ($page['country'] == "Anguilla") echo "selected"; ?> value="Anguilla">Anguilla</option>
          <option  <?php if ($page['country'] == "Antarctica") echo "selected"; ?> value="Antarctica">Antarctica</option>
          <option  <?php if ($page['country'] == "Antigua and Barbuda") echo "selected"; ?> value="Antigua and Barbuda">Antigua and Barbuda</option>
          <option  <?php if ($page['country'] == "Argentina") echo "selected"; ?> value="Argentina">Argentina</option>
          <option  <?php if ($page['country'] == "Armenia") echo "selected"; ?> value="Armenia">Armenia</option>
          <option  <?php if ($page['country'] == "Aruba") echo "selected"; ?> value="Aruba">Aruba</option>
          <option  <?php if ($page['country'] == "Australia") echo "selected"; ?> value="Australia">Australia</option>
          <option  <?php if ($page['country'] == "Austria") echo "selected"; ?> value="Austria">Austria</option>
          <option  <?php if ($page['country'] == "Azerbaijan") echo "selected"; ?> value="Azerbaijan">Azerbaijan</option>
          <option  <?php if ($page['country'] == "Bahamas") echo "selected"; ?> value="Bahamas">Bahamas</option>
          <option  <?php if ($page['country'] == "Bahrain") echo "selected"; ?> value="Bahrain">Bahrain</option>
          <option  <?php if ($page['country'] == "Bangladesh") echo "selected"; ?> value="Bangladesh">Bangladesh</option>
          <option  <?php if ($page['country'] == "Barbados") echo "selected"; ?> value="Barbados">Barbados</option>
          <option  <?php if ($page['country'] == "Belarus") echo "selected"; ?> value="Belarus">Belarus</option>
          <option  <?php if ($page['country'] == "Belgium") echo "selected"; ?> value="Belgium">Belgium</option>
          <option  <?php if ($page['country'] == "Belize") echo "selected"; ?> value="Belize">Belize</option>
          <option  <?php if ($page['country'] == "Benin") echo "selected"; ?> value="Benin">Benin</option>
          <option  <?php if ($page['country'] == "Bermuda") echo "selected"; ?> value="Bermuda">Bermuda</option>
          <option  <?php if ($page['country'] == "Bhutan") echo "selected"; ?> value="Bhutan">Bhutan</option>
          <option  <?php if ($page['country'] == "Bolivia") echo "selected"; ?> value="Bolivia">Bolivia</option>
          <option  <?php if ($page['country'] == "Bosnia and Herzegovina") echo "selected"; ?> value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
          <option  <?php if ($page['country'] == "Botswana") echo "selected"; ?> value="Botswana">Botswana</option>
          <option  <?php if ($page['country'] == "Bouvet Island") echo "selected"; ?> value="Bouvet Island">Bouvet Island</option>
          <option  <?php if ($page['country'] == "Brazil") echo "selected"; ?> value="Brazil">Brazil</option>
          <option  <?php if ($page['country'] == "British Indian Ocean Territory") echo "selected"; ?> value="British Indian Ocean Territory">British Indian Ocean Territory</option>
          <option  <?php if ($page['country'] == "Brunei Darussalam") echo "selected"; ?> value="Brunei Darussalam">Brunei Darussalam</option>
          <option  <?php if ($page['country'] == "Bulgaria") echo "selected"; ?> value="Bulgaria">Bulgaria</option>
          <option  <?php if ($page['country'] == "Burkina Faso") echo "selected"; ?> value="Burkina Faso">Burkina Faso</option>
          <option  <?php if ($page['country'] == "Burundi") echo "selected"; ?> value="Burundi">Burundi</option>
          <option  <?php if ($page['country'] == "Cambodia") echo "selected"; ?> value="Cambodia">Cambodia</option>
          <option  <?php if ($page['country'] == "Cameroon") echo "selected"; ?> value="Cameroon">Cameroon</option>
          <option  <?php if ($page['country'] == "Canada") echo "selected"; ?> value="Canada">Canada</option>
          <option  <?php if ($page['country'] == "Cape Verde") echo "selected"; ?> value="Cape Verde">Cape Verde</option>
          <option  <?php if ($page['country'] == "Cayman Islands") echo "selected"; ?> value="Cayman Islands">Cayman Islands</option>
          <option  <?php if ($page['country'] == "Central African Republic") echo "selected"; ?> value="Central African Republic">Central African Republic</option>
          <option  <?php if ($page['country'] == "Chad") echo "selected"; ?> value="Chad">Chad</option>
          <option  <?php if ($page['country'] == "Chile") echo "selected"; ?> value="Chile">Chile</option>
          <option  <?php if ($page['country'] == "China") echo "selected"; ?> value="China">China</option>
          <option  <?php if ($page['country'] == "Christmas Island") echo "selected"; ?> value="Christmas Island">Christmas Island</option>
          <option  <?php if ($page['country'] == "Cocos (Keeling) Islands") echo "selected"; ?> value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
          <option  <?php if ($page['country'] == "Colombia") echo "selected"; ?> value="Colombia">Colombia</option>
          <option  <?php if ($page['country'] == "Comoros") echo "selected"; ?> value="Comoros">Comoros</option>
          <option  <?php if ($page['country'] == "Congo") echo "selected"; ?> value="Congo">Congo</option>
          <option  <?php if ($page['country'] == "Congo, The Democratic Republic of The") echo "selected"; ?> value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
          <option  <?php if ($page['country'] == "Cook Islands") echo "selected"; ?> value="Cook Islands">Cook Islands</option>
          <option  <?php if ($page['country'] == "Costa Rica") echo "selected"; ?> value="Costa Rica">Costa Rica</option>
          <option  <?php if ($page['country'] == "Cote D'ivoire") echo "selected"; ?> value="Cote D'ivoire">Cote D'ivoire</option>
          <option  <?php if ($page['country'] == "Croatia") echo "selected"; ?> value="Croatia">Croatia</option>
          <option  <?php if ($page['country'] == "Cuba") echo "selected"; ?> value="Cuba">Cuba</option>
          <option  <?php if ($page['country'] == "Cyprus") echo "selected"; ?> value="Cyprus">Cyprus</option>
          <option  <?php if ($page['country'] == "Czech Republic") echo "selected"; ?> value="Czech Republic">Czech Republic</option>
          <option  <?php if ($page['country'] == "Denmark") echo "selected"; ?> value="Denmark">Denmark</option>
          <option  <?php if ($page['country'] == "Djibouti") echo "selected"; ?> value="Djibouti">Djibouti</option>
          <option  <?php if ($page['country'] == "Dominica") echo "selected"; ?> value="Dominica">Dominica</option>
          <option  <?php if ($page['country'] == "Dominican Republic") echo "selected"; ?> value="Dominican Republic">Dominican Republic</option>
          <option  <?php if ($page['country'] == "Ecuador") echo "selected"; ?> value="Ecuador">Ecuador</option>
          <option  <?php if ($page['country'] == "Egypt") echo "selected"; ?> value="Egypt">Egypt</option>
          <option  <?php if ($page['country'] == "El Salvador") echo "selected"; ?> value="El Salvador">El Salvador</option>
          <option  <?php if ($page['country'] == "Equatorial Guinea") echo "selected"; ?> value="Equatorial Guinea">Equatorial Guinea</option>
          <option  <?php if ($page['country'] == "Eritrea") echo "selected"; ?> value="Eritrea">Eritrea</option>
          <option  <?php if ($page['country'] == "Estonia") echo "selected"; ?> value="Estonia">Estonia</option>
          <option  <?php if ($page['country'] == "Ethiopia") echo "selected"; ?> value="Ethiopia">Ethiopia</option>
          <option  <?php if ($page['country'] == "Falkland Islands (Malvinas)") echo "selected"; ?> value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
          <option  <?php if ($page['country'] == "Faroe Islands") echo "selected"; ?> value="Faroe Islands">Faroe Islands</option>
          <option  <?php if ($page['country'] == "Fiji") echo "selected"; ?> value="Fiji">Fiji</option>
          <option  <?php if ($page['country'] == "Finland") echo "selected"; ?> value="Finland">Finland</option>
          <option  <?php if ($page['country'] == "France") echo "selected"; ?> value="France">France</option>
          <option  <?php if ($page['country'] == "French Guiana") echo "selected"; ?> value="French Guiana">French Guiana</option>
          <option  <?php if ($page['country'] == "French Polynesia") echo "selected"; ?> value="French Polynesia">French Polynesia</option>
          <option  <?php if ($page['country'] == "French Southern Territories") echo "selected"; ?> value="French Southern Territories">French Southern Territories</option>
          <option  <?php if ($page['country'] == "Gabon") echo "selected"; ?> value="Gabon">Gabon</option>
          <option  <?php if ($page['country'] == "Gambia") echo "selected"; ?> value="Gambia">Gambia</option>
          <option  <?php if ($page['country'] == "Georgia") echo "selected"; ?> value="Georgia">Georgia</option>
          <option  <?php if ($page['country'] == "Germany") echo "selected"; ?> value="Germany">Germany</option>
          <option  <?php if ($page['country'] == "Ghana") echo "selected"; ?> value="Ghana">Ghana</option>
          <option  <?php if ($page['country'] == "Gibraltar") echo "selected"; ?> value="Gibraltar">Gibraltar</option>
          <option  <?php if ($page['country'] == "Greece") echo "selected"; ?> value="Greece">Greece</option>
          <option  <?php if ($page['country'] == "Greenland") echo "selected"; ?> value="Greenland">Greenland</option>
          <option  <?php if ($page['country'] == "Grenada") echo "selected"; ?> value="Grenada">Grenada</option>
          <option  <?php if ($page['country'] == "Guadeloupe") echo "selected"; ?> value="Guadeloupe">Guadeloupe</option>
          <option  <?php if ($page['country'] == "Guam") echo "selected"; ?> value="Guam">Guam</option>
          <option  <?php if ($page['country'] == "Guatemala") echo "selected"; ?> value="Guatemala">Guatemala</option>
          <option  <?php if ($page['country'] == "Guinea") echo "selected"; ?> value="Guinea">Guinea</option>
          <option  <?php if ($page['country'] == "Guinea-bissau") echo "selected"; ?> value="Guinea-bissau">Guinea-bissau</option>
          <option  <?php if ($page['country'] == "Guyana") echo "selected"; ?> value="Guyana">Guyana</option>
          <option  <?php if ($page['country'] == "Haiti") echo "selected"; ?> value="Haiti">Haiti</option>
          <option  <?php if ($page['country'] == "Heard Island and Mcdonald Islands") echo "selected"; ?> value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
          <option  <?php if ($page['country'] == "Holy See (Vatican City State)") echo "selected"; ?> value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
          <option  <?php if ($page['country'] == "Honduras") echo "selected"; ?> value="Honduras">Honduras</option>
          <option  <?php if ($page['country'] == "Hong Kong") echo "selected"; ?> value="Hong Kong">Hong Kong</option>
          <option  <?php if ($page['country'] == "Hungary") echo "selected"; ?> value="Hungary">Hungary</option>
          <option  <?php if ($page['country'] == "Iceland") echo "selected"; ?> value="Iceland">Iceland</option>
          <option  <?php if ($page['country'] == "India") echo "selected"; ?> value="India">India</option>
          <option  <?php if ($page['country'] == "Indonesia") echo "selected"; ?> value="Indonesia">Indonesia</option>
          <option  <?php if ($page['country'] == "Iran, Islamic Republic of") echo "selected"; ?> value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
          <option  <?php if ($page['country'] == "Iraq") echo "selected"; ?> value="Iraq">Iraq</option>
          <option  <?php if ($page['country'] == "Ireland") echo "selected"; ?> value="Ireland">Ireland</option>
          <option  <?php if ($page['country'] == "Israel") echo "selected"; ?> value="Israel">Israel</option>
          <option  <?php if ($page['country'] == "Italy") echo "selected"; ?> value="Italy">Italy</option>
          <option  <?php if ($page['country'] == "Jamaica") echo "selected"; ?> value="Jamaica">Jamaica</option>
          <option  <?php if ($page['country'] == "Japan") echo "selected"; ?> value="Japan">Japan</option>
          <option  <?php if ($page['country'] == "Jordan") echo "selected"; ?> value="Jordan">Jordan</option>
          <option  <?php if ($page['country'] == "Kazakhstan") echo "selected"; ?> value="Kazakhstan">Kazakhstan</option>
          <option  <?php if ($page['country'] == "Kenya") echo "selected"; ?> value="Kenya">Kenya</option>
          <option  <?php if ($page['country'] == "Kiribati") echo "selected"; ?> value="Kiribati">Kiribati</option>
          <option  <?php if ($page['country'] == "Korea") echo "selected"; ?> value="Korea">Korea</option>
          <option  <?php if ($page['country'] == "Korea, Republic of") echo "selected"; ?> value="Korea, Republic of">Korea, Republic of</option>
          <option  <?php if ($page['country'] == "Kuwait") echo "selected"; ?> value="Kuwait">Kuwait</option>
          <option  <?php if ($page['country'] == "Kyrgyzstan") echo "selected"; ?> value="Kyrgyzstan">Kyrgyzstan</option>
          <option  <?php if ($page['country'] == "Lao People's Democratic Republic") echo "selected"; ?> value="Lao People's Democratic Republic">Lao People's Democratic Republic</option>
          <option  <?php if ($page['country'] == "Latvia") echo "selected"; ?> value="Latvia">Latvia</option>
          <option  <?php if ($page['country'] == "Lebanon") echo "selected"; ?> value="Lebanon">Lebanon</option>
          <option  <?php if ($page['country'] == "Lesotho") echo "selected"; ?> value="Lesotho">Lesotho</option>
          <option  <?php if ($page['country'] == "Liberia") echo "selected"; ?> value="Liberia">Liberia</option>
          <option  <?php if ($page['country'] == "Libyan Arab Jamahiriya") echo "selected"; ?> value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option>
          <option  <?php if ($page['country'] == "Liechtenstein") echo "selected"; ?> value="Liechtenstein">Liechtenstein</option>
          <option  <?php if ($page['country'] == "Lithuania") echo "selected"; ?> value="Lithuania">Lithuania</option>
          <option  <?php if ($page['country'] == "Luxembourg") echo "selected"; ?> value="Luxembourg">Luxembourg</option>
          <option  <?php if ($page['country'] == "Macao") echo "selected"; ?> value="Macao">Macao</option>
          <option  <?php if ($page['country'] == "Macedonia") echo "selected"; ?> value="Macedonia">Macedonia</option>
          <option  <?php if ($page['country'] == "Madagascar") echo "selected"; ?> value="Madagascar">Madagascar</option>
          <option  <?php if ($page['country'] == "Malawi") echo "selected"; ?> value="Malawi">Malawi</option>
          <option  <?php if ($page['country'] == "Malaysia") echo "selected"; ?> value="Malaysia">Malaysia</option>
          <option  <?php if ($page['country'] == "Maldives") echo "selected"; ?> value="Maldives">Maldives</option>
          <option  <?php if ($page['country'] == "Mali") echo "selected"; ?> value="Mali">Mali</option>
          <option  <?php if ($page['country'] == "Malta") echo "selected"; ?> value="Malta">Malta</option>
          <option  <?php if ($page['country'] == "Marshall Islands") echo "selected"; ?> value="Marshall Islands">Marshall Islands</option>
          <option  <?php if ($page['country'] == "Martinique") echo "selected"; ?> value="Martinique">Martinique</option>
          <option  <?php if ($page['country'] == "Mauritania") echo "selected"; ?> value="Mauritania">Mauritania</option>
          <option  <?php if ($page['country'] == "Mauritius") echo "selected"; ?> value="Mauritius">Mauritius</option>
          <option  <?php if ($page['country'] == "Mayotte") echo "selected"; ?> value="Mayotte">Mayotte</option>
          <option  <?php if ($page['country'] == "Mexico") echo "selected"; ?> value="Mexico">Mexico</option>
          <option  <?php if ($page['country'] == "Micronesia") echo "selected"; ?> value="Micronesia">Micronesia</option>
          <option  <?php if ($page['country'] == "Moldova") echo "selected"; ?> value="Moldova">Moldova</option>
          <option  <?php if ($page['country'] == "Monaco") echo "selected"; ?> value="Monaco">Monaco</option>
          <option  <?php if ($page['country'] == "Mongolia") echo "selected"; ?> value="Mongolia">Mongolia</option>
          <option  <?php if ($page['country'] == "Montserrat") echo "selected"; ?> value="Montserrat">Montserrat</option>
          <option  <?php if ($page['country'] == "Morocco") echo "selected"; ?> value="Morocco">Morocco</option>
          <option  <?php if ($page['country'] == "Mozambique") echo "selected"; ?> value="Mozambique">Mozambique</option>
          <option  <?php if ($page['country'] == "Myanmar") echo "selected"; ?> value="Myanmar">Myanmar</option>
          <option  <?php if ($page['country'] == "Namibia") echo "selected"; ?> value="Namibia">Namibia</option>
          <option  <?php if ($page['country'] == "Naurux") echo "selected"; ?> value="Nauru">Nauru</option>
          <option  <?php if ($page['country'] == "Nepal") echo "selected"; ?> value="Nepal">Nepal</option>
          <option  <?php if ($page['country'] == "Netherlands") echo "selected"; ?> value="Netherlands">Netherlands</option>
          <option  <?php if ($page['country'] == "Netherlands Antilles") echo "selected"; ?> value="Netherlands Antilles">Netherlands Antilles</option>
          <option  <?php if ($page['country'] == "New Caledonia") echo "selected"; ?> value="New Caledonia">New Caledonia</option>
          <option  <?php if ($page['country'] == "New Zealand") echo "selected"; ?> value="New Zealand">New Zealand</option>
          <option  <?php if ($page['country'] == "Nicaragua") echo "selected"; ?> value="Nicaragua">Nicaragua</option>
          <option  <?php if ($page['country'] == "Niger") echo "selected"; ?> value="Niger">Niger</option>
          <option  <?php if ($page['country'] == "Nigeria") echo "selected"; ?> value="Nigeria">Nigeria</option>
          <option  <?php if ($page['country'] == "Niue") echo "selected"; ?> value="Niue">Niue</option>
          <option  <?php if ($page['country'] == "Norfolk Island") echo "selected"; ?> value="Norfolk Island">Norfolk Island</option>
          <option  <?php if ($page['country'] == "Northern Mariana Islands") echo "selected"; ?> value="Northern Mariana Islands">Northern Mariana Islands</option>
          <option  <?php if ($page['country'] == "Norway") echo "selected"; ?> value="Norway">Norway</option>
          <option  <?php if ($page['country'] == "Oman") echo "selected"; ?> value="Oman">Oman</option>
          <option  <?php if ($page['country'] == "Pakistan") echo "selected"; ?> value="Pakistan">Pakistan</option>
          <option  <?php if ($page['country'] == "Palau") echo "selected"; ?> value="Palau">Palau</option>
          <option  <?php if ($page['country'] == "Palestinian Territory, Occupied") echo "selected"; ?> value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
          <option  <?php if ($page['country'] == "Panama") echo "selected"; ?> value="Panama">Panama</option>
          <option  <?php if ($page['country'] == "Papua New Guinea") echo "selected"; ?> value="Papua New Guinea">Papua New Guinea</option>
          <option  <?php if ($page['country'] == "Paraguay") echo "selected"; ?> value="Paraguay">Paraguay</option>
          <option  <?php if ($page['country'] == "Peru") echo "selected"; ?> value="Peru">Peru</option>
          <option  <?php if ($page['country'] == "Philippines") echo "selected"; ?> value="Philippines">Philippines</option>
          <option  <?php if ($page['country'] == "Pitcairn") echo "selected"; ?> value="Pitcairn">Pitcairn</option>
          <option  <?php if ($page['country'] == "Poland") echo "selected"; ?> value="Poland">Poland</option>
          <option  <?php if ($page['country'] == "Portugal") echo "selected"; ?> value="Portugal">Portugal</option>
          <option  <?php if ($page['country'] == "Puerto Rico") echo "selected"; ?> value="Puerto Rico">Puerto Rico</option>
          <option  <?php if ($page['country'] == "Qatar") echo "selected"; ?> value="Qatar">Qatar</option>
          <option  <?php if ($page['country'] == "Reunion") echo "selected"; ?> value="Reunion">Reunion</option>
          <option  <?php if ($page['country'] == "Romania") echo "selected"; ?> value="Romania">Romania</option>
          <option  <?php if ($page['country'] == "Russian Federation") echo "selected"; ?> value="Russian Federation">Russian Federation</option>
          <option  <?php if ($page['country'] == "Rwanda") echo "selected"; ?> value="Rwanda">Rwanda</option>
          <option  <?php if ($page['country'] == "Saint Helena") echo "selected"; ?> value="Saint Helena">Saint Helena</option>
          <option  <?php if ($page['country'] == "Saint Kitts and Nevis") echo "selected"; ?> value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
          <option  <?php if ($page['country'] == "Saint Lucia") echo "selected"; ?> value="Saint Lucia">Saint Lucia</option>
          <option  <?php if ($page['country'] == "Saint Pierre and Miquelon") echo "selected"; ?> value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
          <option  <?php if ($page['country'] == "Saint Vincent and The Grenadines") echo "selected"; ?> value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
          <option  <?php if ($page['country'] == "Samoa") echo "selected"; ?> value="Samoa">Samoa</option>
          <option  <?php if ($page['country'] == "San Marino") echo "selected"; ?> value="San Marino">San Marino</option>
          <option  <?php if ($page['country'] == "Sao Tome and Principe") echo "selected"; ?> value="Sao Tome and Principe">Sao Tome and Principe</option>
          <option  <?php if ($page['country'] == "Saudi Arabia") echo "selected"; ?> value="Saudi Arabia">Saudi Arabia</option>
          <option  <?php if ($page['country'] == "Senegal") echo "selected"; ?> value="Senegal">Senegal</option>
          <option  <?php if ($page['country'] == "Serbia and Montenegro") echo "selected"; ?> value="Serbia and Montenegro">Serbia and Montenegro</option>
          <option  <?php if ($page['country'] == "Seychelles") echo "selected"; ?> value="Seychelles">Seychelles</option>
          <option  <?php if ($page['country'] == "Sierra Leone") echo "selected"; ?> value="Sierra Leone">Sierra Leone</option>
          <option  <?php if ($page['country'] == "Singapore") echo "selected"; ?> value="Singapore">Singapore</option>
          <option  <?php if ($page['country'] == "Slovakia") echo "selected"; ?> value="Slovakia">Slovakia</option>
          <option  <?php if ($page['country'] == "Slovenia") echo "selected"; ?> value="Slovenia">Slovenia</option>
          <option  <?php if ($page['country'] == "Solomon Islands") echo "selected"; ?> value="Solomon Islands">Solomon Islands</option>
          <option  <?php if ($page['country'] == "Somalia") echo "selected"; ?> value="Somalia">Somalia</option>
          <option  <?php if ($page['country'] == "South Africa") echo "selected"; ?> value="South Africa">South Africa</option>
          <option  <?php if ($page['country'] == "South Georgia and The South Sandwich Islands") echo "selected"; ?> value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
          <option  <?php if ($page['country'] == "Spain") echo "selected"; ?> value="Spain">Spain</option>
          <option  <?php if ($page['country'] == "Sri Lanka") echo "selected"; ?> value="Sri Lanka">Sri Lanka</option>
          <option  <?php if ($page['country'] == "Sudan") echo "selected"; ?> value="Sudan">Sudan</option>
          <option  <?php if ($page['country'] == "Suriname") echo "selected"; ?> value="Suriname">Suriname</option>
          <option  <?php if ($page['country'] == "Svalbard and Jan Mayen") echo "selected"; ?> value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
          <option  <?php if ($page['country'] == "Swaziland") echo "selected"; ?> value="Swaziland">Swaziland</option>
          <option  <?php if ($page['country'] == "Sweden") echo "selected"; ?> value="Sweden">Sweden</option>
          <option  <?php if ($page['country'] == "Switzerland") echo "selected"; ?> value="Switzerland">Switzerland</option>
          <option  <?php if ($page['country'] == "Syrian Arab Republic") echo "selected"; ?> value="Syrian Arab Republic">Syrian Arab Republic</option>
          <option  <?php if ($page['country'] == "Taiwan, Province of China") echo "selected"; ?> value="Taiwan, Province of China">Taiwan, Province of China</option>
          <option  <?php if ($page['country'] == "Tajikistan") echo "selected"; ?> value="Tajikistan">Tajikistan</option>
          <option  <?php if ($page['country'] == "Tanzania, United Republic of") echo "selected"; ?> value="Tanzania, United Republic of">Tanzania, United Republic of</option>
          <option  <?php if ($page['country'] == "Thailand") echo "selected"; ?> value="Thailand">Thailand</option>
          <option  <?php if ($page['country'] == "Timor-leste") echo "selected"; ?> value="Timor-leste">Timor-leste</option>
          <option  <?php if ($page['country'] == "Togo") echo "selected"; ?> value="Togo">Togo</option>
          <option  <?php if ($page['country'] == "Tokelau") echo "selected"; ?> value="Tokelau">Tokelau</option>
          <option  <?php if ($page['country'] == "Tonga") echo "selected"; ?> value="Tonga">Tonga</option>
          <option  <?php if ($page['country'] == "Trinidad and Tobago") echo "selected"; ?> value="Trinidad and Tobago">Trinidad and Tobago</option>
          <option  <?php if ($page['country'] == "Tunisia") echo "selected"; ?> value="Tunisia">Tunisia</option>
          <option  <?php if ($page['country'] == "Turkey") echo "selected"; ?> value="Turkey">Turkey</option>
          <option  <?php if ($page['country'] == "Turkmenistan") echo "selected"; ?> value="Turkmenistan">Turkmenistan</option>
          <option  <?php if ($page['country'] == "Turks and Caicos Islands") echo "selected"; ?> value="Turks and Caicos Islands">Turks and Caicos Islands</option>
          <option  <?php if ($page['country'] == "Tuvalu") echo "selected"; ?> value="Tuvalu">Tuvalu</option>
          <option  <?php if ($page['country'] == "Uganda") echo "selected"; ?> value="Uganda">Uganda</option>
          <option  <?php if ($page['country'] == "Ukraine") echo "selected"; ?> value="Ukraine">Ukraine</option>
          <option  <?php if ($page['country'] == "United Arab Emirates") echo "selected"; ?> value="United Arab Emirates">United Arab Emirates</option>
          <option  <?php if ($page['country'] == "United Kingdom") echo "selected"; ?> value="United Kingdom">United Kingdom</option>
          <option  <?php if ($page['country'] == "United States") echo "selected"; ?> value="United States">United States</option>
          <option  <?php if ($page['country'] == "United States Minor Outlying Islands") echo "selected"; ?> value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
          <option  <?php if ($page['country'] == "Uruguay") echo "selected"; ?> value="Uruguay">Uruguay</option>
          <option  <?php if ($page['country'] == "Uzbekistan") echo "selected"; ?> value="Uzbekistan">Uzbekistan</option>
          <option  <?php if ($page['country'] == "Vanuatu") echo "selected"; ?> value="Vanuatu">Vanuatu</option>
          <option  <?php if ($page['country'] == "Venezuela") echo "selected"; ?> value="Venezuela">Venezuela</option>
          <option  <?php if ($page['country'] == "Viet Nam") echo "selected"; ?> value="Viet Nam">Viet Nam</option>
          <option  <?php if ($page['country'] == "Virgin Islands, British") echo "selected"; ?> value="Virgin Islands, British">Virgin Islands, British</option>
          <option  <?php if ($page['country'] == "Virgin Islands, U.S.") echo "selected"; ?> value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
          <option  <?php if ($page['country'] == "Wallis and Futuna") echo "selected"; ?> value="Wallis and Futuna">Wallis and Futuna</option>
          <option  <?php if ($page['country'] == "Western Sahara") echo "selected"; ?> value="Western Sahara">Western Sahara</option>
          <option  <?php if ($page['country'] == "Yemen") echo "selected"; ?> value="Yemen">Yemen</option>
          <option  <?php if ($page['country'] == "Zambia") echo "selected"; ?> value="Zambia">Zambia</option>
          <option  <?php if ($page['country'] == "Zimbabwe") echo "selected"; ?> value="Zimbabwe">Zimbabwe</option>

      <td colspan="2"> </td>
      <td colspan="2">
        <div style="padding-top: 5px;">
          <input type="submit" name="donate" value="DONATE" />



Unfortunately, that tutorial is for Form Tools 1 - it won't be up to date for version 2 yet. The majority of the code will be the same, but not identical.

Sorry about that! I'm just working on another tutorial today, but I can try and get that written next if you need it. When's your project due?

btw, the reason that function isn't found is that you need to update the line that includes the api.php file from this:

PHP Code:

to use a path (not URL!), e.g.

PHP Code:

URL's won't work for this.

- Ben
Awesome! Thanks. I figured it out. It's at least showing the page now.

If you could work on that tutorial next, I would greatly appreciate it. I have to get this paypal working asap, so I'll keep trying. And if I can't get it working by the time you're done with it, I'll use it. Smile
I'm at a loss trying to figure out how to get paypal to work with Form Tools. I've tried all I can think of with the tutorial that you have right now, and I still can't get anywhere. Do you happen to have the paypal tutorial updated for Form Tools 2?
Hey sebgonz,

No - it's not quite done yet. I decided to refactor a lot of the PayPal code because it really wasn't very good - it was written way back in 2004 and it's really not very good at all. I don't blame them at all, but it does cause all sorts of minor errors to be displayed if your error reporting is set high (as with Form Tools 2 beta).

I'm organizing it better so that you only need to edit a single file (other than customizations to the form styles, obviously) for the settings. I should get it done later today - pop back then. I'll post a link to the tutorial here. :-)

- Ben
Hey sebgonz,

DONE! Finally! I ended up re-writing & restructuring a lot of the tutorial as well. I think it's a lot clearer than the previous version, but of course let me know if you have any questions!

- Ben

Forum Jump:

Users browsing this thread: 1 Guest(s)