hantaah Posted February 18, 2013 Share Posted February 18, 2013 I am new to php and I'm trying to make a donation centre in my new site here: http://www.sakeenaheducationcentre.com/our-mission/ I'm a little confused as to what goes exactly where so would really appreciate a good nudge in the right direction. So far I have: -added two tables to my database ( dc_donations and dc_comments. The first stores the donation data which is passed in a request from PayPal, The second table holds the information about the donors, which they fill for themselves on the thank you page. ) -Added the xhtml to the html input field in the wordpress " pages " section ( There is php code there so I'm not sure if this code goes here, if not where should I place it? ) -All the php files I have placed side by side with all my other php files such as home.php / footer.php etc. The files incude: config.php ( with paypal config details ) connect.php ( with database connection details ) and content.php With regards to these files how do I call to them from the xhtml? Are they in the right place?# Many thanks for any help in advance Quote Link to comment https://forums.phpfreaks.com/topic/274644-making-a-php-donbation-centre-in-my-wordpress-site/ Share on other sites More sharing options...
Mikey Posted February 20, 2013 Share Posted February 20, 2013 Well if you want to use PayPal's donation features, first ensure you have a business account on PayPal. Then visit PayPal and get their button code, and you'll also need to use the PayPal IPN in order to get things like response codes to your site which you can then log in your database and even grab details like the email address from. Quote Link to comment https://forums.phpfreaks.com/topic/274644-making-a-php-donbation-centre-in-my-wordpress-site/#findComment-1413563 Share on other sites More sharing options...
hantaah Posted February 20, 2013 Author Share Posted February 20, 2013 Please please please I really hope someone can help me as I'm trying to setup a donation centre as directed by this tutorial: http://tutorialzine.com/2010/05/donation-center-php-mysql-paypal-api/ The problem with this tutorial is that it is very vague. I have put in all the xhtml and added the two databases. I have placed all the .php files side by side in this directory: http://sakeenaheducationcentre.com/wp-content/themes/StyleShop I have placed this in the head: <?php require "http://sakeenaheducationcentre.com/wp-content/themes/StyleShop/config.php"; require "http://sakeenaheducationcentre.com/wp-content/themes/StyleShop"; // Determining the URL of the page: $url = 'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER["REQUEST_URI"]); // Fetching the number and the sum of the donations: list($number,$sum) = mysql_fetch_array(mysql_query("SELECT COUNT(*),SUM(amount) FROM dc_donations")); // Calculating how many percent of the goal were met: $percent = round(min(100*($sum/$goal),100)); // Building a URL with Google's Chart API: $chartURL = 'http://chart.apis.google.com/chart?chf=bg,s,f9faf7&cht=p&chd=t:'.$percent.',-'.(100-$percent).'&chs=200x200&chco=639600&chp=1.57'; ?> ------------------------------------------------------------------------------------------------------------------ I Just don't know what to do to get it to work - It's corrently in demo mode but I can't seem to even donate in demo mode or get the green chart up. I'm also not sure what info to add where for real donations. I'm not sure about the paypal_class and assigning it PayPal’s URLor about calling the $p->validate_ipn() I'd really really appreciate a nudge in the right direction, I've been working on it for such a long time, although I've figured quite a lot out and progressed with some thinking I'm not at a stand still. I really hope you can help Many Thanks my page is http://www.sakeenaheducationcentre.com/our-mission Quote Link to comment https://forums.phpfreaks.com/topic/274644-making-a-php-donbation-centre-in-my-wordpress-site/#findComment-1413656 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.