<p>To get started with the Cardano Serialization Lib, have a look at their examples (with code) in the Cardano Developer Portal: <a href="https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions" rel="nofollow noreferrer">https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions</a></p>
<p>That being said, there are more high level libraries nowadays that make building transactions a lot more simple than using the Cardano Serialization Lib.</p>
<p>Edit: You don't even need to have any backend (server side code like PHP) if you just want to send some ADA from the users wallet to some other address.
You could use a JavaScript library that gets the UTXOs from the wallet-connect API, builds the transaction and submits it using the wallet-connect API.
See for example this: <a href="https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions" rel="nofollow noreferrer">https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions</a></p>

CC BY-SA 4.0
2023-03-22T16:26:02.293Z
Looking at: https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions

I need guidance on how to insert this into a php page, so the user clicks a button to make this transaction take place. The link is just code, there needs to be an action for this code to take place. Am I missing something?
lovetoshi
CC BY-SA 4.0
2023-03-23T07:50:36.750Z
PHP code is executed on the server. I'm not aware of any PHP port of the serialization lib. This simple use case of sending ADA from the user wallet to another address can be done completely in the browser (using JavaScript). Therefore I suggested that you could use MeshJS. You would import the library in your HTML and then you can add a button that calls a JavaScript function. This function creates the transaction and submits it through the wallet in the users brwoser.
eddex
CC BY-SA 4.0
2023-03-23T23:01:57.130Z
"This simple use case of sending ADA from the user wallet to another address can be done completely in the browser (using JavaScript)." Can you show me an example of this code working in Javascript?
lovetoshi
CC BY-SA 4.0
2023-03-27T10:44:02.963Z
Some examples using the MeshJs library can be found here: https://developers.cardano.org/docs/get-started/mesh/transactions-basic
eddex
CC BY-SA 4.0
2023-03-22T14:51:26.603Z
2023-03-22T15:00:30.433Z
2023-03-22T15:00:30.433Z
eddex
<p>new to coding here. (obviously)</p>
<p>I am looking to understand how this works, and I am sure if I physically see the code I will pick up on it quick.</p>
<p>I am looking for a very simple script that sends ADA to a specified address when a user clicks a send button, preferably in PHP. I already have connect to wallet working on my site, I am just incredibly lost on sending ADA.</p>
<p>Thanks in advance.</p>

<ada>
Can anyone provide an easy to understand script that sends ADA using the Cardano Serialization Lib?
# Can anyone provide an easy to understand script that sends ADA using the Cardano Serialization Lib?

(Asked by: username_0 on 2023-03-22)

new to coding here. (obviously)

I am looking to understand how this works, and I am sure if I physically see the code I will pick up on it quick.

I am looking for a very simple script that sends ADA to a specified address when a user clicks a send button, preferably in PHP. I already have connect to wallet working on my site, I am just incredibly lost on sending ADA.

Thanks in advance.

**Tags:** ada

---

## 1 answers

### Answer by username_1 on 2023-03-22. Score: 1

To get started with the Cardano Serialization Lib, have a look at their examples (with code) in the Cardano Developer Portal: <https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions>

That being said, there are more high level libraries nowadays that make building transactions a lot more simple than using the Cardano Serialization Lib.

Edit: You don't even need to have any backend (server side code like PHP) if you just want to send some ADA from the users wallet to some other address.
You could use a JavaScript library that gets the UTXOs from the wallet-connect API, builds the transaction and submits it using the wallet-connect API.
See for example this: <https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions>

> **Comments:**
> **username_0**: Looking at: https://developers.cardano.org/docs/get-started/cardano-serialization-lib/generating-transactions  I need guidance on how to insert this into a php page, so the user clicks a button to make this transaction take place. The link is just code, there needs to be an action for this code to take place. Am I missing something?  
> **username_1**: PHP code is executed on the server. I'm not aware of any PHP port of the serialization lib. This simple use case of sending ADA from the user wallet to another address can be done completely in the browser (using JavaScript). Therefore I suggested that you could use MeshJS. You would import the library in your HTML and then you can add a button that calls a JavaScript function. This function creates the transaction and submits it through the wallet in the users brwoser.  
> **username_0**: "This simple use case of sending ADA from the user wallet to another address can be done completely in the browser (using JavaScript)." Can you show me an example of this code working in Javascript?  
> **username_1**: Some examples using the MeshJs library can be found here: https://developers.cardano.org/docs/get-started/mesh/transactions-basic  

---

