The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> PayPal checkout and PHP
tudsy
post Aug 4 2022, 03:48 AM
Post #1


Advanced Member
****

Group: Members
Posts: 246
Joined: 30-September 14
Member No.: 21,611



Hi

I am trying to process transactions using PayPal SDK. I also want to pass php variables to the PayPal code found on their (PayPal) website.

Attached is process1.txt(php) which has the php and the paypal code for a paypal button inside.


Any help will be appreciated.

Thanks. biggrin.gif


Attached File(s)
Attached File  process1.txt ( 5.64k ) Number of downloads: 448
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
CharlesEF
post Aug 4 2022, 07:13 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



If this is a paypal process script 'process1.txt(php)' then why all the javascript? PHP (server side scripting) can't run javascript, only the browser can (that's why it's called client side scripting). Javascript can call a PHP script but only if you use AJAX.

Do you want the form to submit when the paypal button is clicked?
Or, do you want the form to stay in place when the paypal button is clicked?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
tudsy
post Aug 5 2022, 08:11 AM
Post #3


Advanced Member
****

Group: Members
Posts: 246
Joined: 30-September 14
Member No.: 21,611



Hi

Thanks for that.

When the form is submitted and the PayPal button is clicked, I want the Price, Graphic and url information appearing in the PayPal environment. I might take up your suggestion to use AJAX.

Thanks.





QUOTE(CharlesEF @ Aug 5 2022, 09:43 AM) *

If this is a paypal process script 'process1.txt(php)' then why all the javascript? PHP (server side scripting) can't run javascript, only the browser can (that's why it's called client side scripting). Javascript can call a PHP script but only if you use AJAX.

Do you want the form to submit when the paypal button is clicked?
Or, do you want the form to stay in place when the paypal button is clicked?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Aug 5 2022, 02:29 PM
Post #4


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(tudsy @ Aug 5 2022, 08:11 AM) *

Hi

Thanks for that.

When the form is submitted and the PayPal button is clicked, I want the Price, Graphic and url information appearing in the PayPal environment. I might take up your suggestion to use AJAX.

Thanks.

If you want the form to submit then all you have to do is make sure that each value you want to send to the PHP script is in some HTML element that will be part of the $_POST array. Price and Graphic might already be in an HTML element. URL might need to be placed in a hidden input so it will be sent to the server in the $_POST array. You might not need the URL in the $_POST array at all, just hard code it in the PHP script. I'm not sure what information is in the URL but do you want users to 'view source' and see it?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic
tudsy   PayPal checkout and PHP   Aug 4 2022, 03:48 AM
CharlesEF   If this is a paypal process script 'process1.t...   Aug 4 2022, 07:13 PM
tudsy   Hi Thanks for that. When the form is submitted ...   Aug 5 2022, 08:11 AM
CharlesEF   Hi Thanks for that. When the form is submitted...   Aug 5 2022, 02:29 PM
tudsy   Hi Thanks for that. When I include the updated p...   Aug 11 2022, 09:40 AM
CharlesEF   A 'white screen' normally means there is a...   Aug 13 2022, 02:47 PM
tudsy   Hi Thanks for that. There is no error file produc...   Aug 18 2022, 03:55 AM
tudsy   Hi Thanks for that. There is no error file produc...   Aug 18 2022, 03:56 AM
CharlesEF   The only thing that I see is a syntax error. This...   Aug 17 2022, 01:44 AM
CharlesEF   What version of PHP do you use? When I upgraded t...   Aug 18 2022, 02:42 PM
tudsy   php 8.1 What version of PHP do you use? W...   Aug 18 2022, 02:52 PM
CharlesEF   Insert this line at the top of your PHP script: in...   Aug 18 2022, 08:46 PM
tudsy   Hi I have added 3 hidden input tags in process1.p...   Sep 7 2022, 08:10 AM
CharlesEF   Hidden inputs are HTML elements. They go inside t...   Sep 7 2022, 02:39 PM
CharlesEF   Did any of the error reporting methods work for yo...   Sep 7 2022, 04:27 PM
tudsy   Hi Sorry for the late reply. Yes the error repo...   Sep 12 2022, 09:29 AM
tudsy   Hi I found this piece of code on the web: <?p...   Sep 12 2022, 12:13 PM
CharlesEF   If error reporting is working now then why do you ...   Sep 12 2022, 04:39 PM
tudsy   Hi Just a quick one. By any chance you had a look...   Oct 5 2022, 09:22 AM
CharlesEF   Exactly what problem are you having? I thought it...   Oct 6 2022, 03:16 PM
tudsy   Hi Thanks for that. Process1.php (txt) inserts d...   Oct 15 2022, 09:36 PM
CharlesEF   I don't think I will be able to help this time...   Oct 16 2022, 01:30 AM
CharlesEF   Also, I didn't see any button in your HTML. I...   Oct 16 2022, 05:27 PM
tudsy   Hi After talking to the PayPal community, I have ...   Nov 17 2022, 09:31 AM
CharlesEF   The for attribute of a label should point to the i...   Nov 17 2022, 02:19 PM
CharlesEF   If you don't want to stay on the same page dur...   Nov 17 2022, 04:33 PM
tudsy   Hi Hi I have solved the problem of writing data ...   Nov 26 2022, 04:41 AM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th May 2024 - 01:54 AM