Apr 12th, 2010, 7:53 AM
Ben,
OK .. I have figured out what was wrong with the way I was adding the I have also verified that the library item is being called and that the $$pp(array) is available in my form page. I have also verified that the initialize mode is being called but the form will not redirect to my thanks.php page when I click the PayPal button. I have also verified that the name of the Paypal button is "submit" and that the name has been properly added to the api code at the top of my page. However, when I click the PayPal button, all it does is output all the $_POST variables to the top of my page
Now, the only thing I can think of is that there is something in the way that I am putting this form together that is interfering with the proper execution. There are three files involved in this page. There is file1.php, which basically houses some JavaScript functions and the form code (built dynamically). This file also calls file2.php, which has some php functions and also calls the html template I use to place the form into. So perhaps the separate require_once calls are stopping the api from functioning?
Dave
OK .. I have figured out what was wrong with the way I was adding the
PHP Code:
action="<?php echo $_SERVER["PHP_SELF"]?>"
Now, the only thing I can think of is that there is something in the way that I am putting this form together that is interfering with the proper execution. There are three files involved in this page. There is file1.php, which basically houses some JavaScript functions and the form code (built dynamically). This file also calls file2.php, which has some php functions and also calls the html template I use to place the form into. So perhaps the separate require_once calls are stopping the api from functioning?
Dave
(Apr 11th, 2010, 2:29 PM)filch Wrote: I am creating a PayPal payment form and have been following the paypla form tutorial. I have been stumped by, what appears to be a very silly error. Every time I add the code to use the included library.php file, it stops the php on the page from rendering. See the attached image.
I have the following code, which all looks OK. (note that there is more code after this snippet but it renders fine, as long as I do not have the formtools code in there. I also have to keep the formtools code in ints own php block ... otherwise, the rest of the code will not render either.
PHP Code:<?php
//$curr_folder = dirname(__FILE__);
require_once("../conference/includes/library.php");
$fields = ft_api_init_form_page($pp["form_id"], $pp["mode"]);
if ($pp["mode"] == "initialize")
{
$params = array(
"submit_button" => "submit",
"next_page" => "thanks.php",
"form_data" => $_POST,
"finalize" => true
);
}
else
{
$params = array(
"submit_button" => "submit",
"next_page" => "paypal_submit.php",
"form_data" => $_POST
);
}
ft_api_process_form($params);
?>
Really appreciate if you could have a look at this as I need to get this live by tomorrow AM.
Dave