Reputation: 63
What's the best way to get an ETH address from a website form submission (php) passed to a smart contract in order that the smart contract can send some new minted Tokens to the ETH address collected in the php form?
The user submitting the ETH address on the website does not have any ETH so we will have to pay for the Gas for any transactions.
The user's ETH address submitted on the php form is different to the msg.sender address (us).
Have been considering using PHP with: https://github.com/digitaldonkey/ethereum-php
But is there an easier approach? Thank you
Upvotes: 4
Views: 1983
Reputation: 1960
If you want to call a method on the smart contract, you have to sign and send a transaction. In your case you want to sign the transaction from inside PHP.
To sign a transaction you need
I don't know how to do this from PHP but in JS you would use https://github.com/ethereumjs/ethereumjs-tx
Upvotes: 3