See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Interact with MetaMask via PHP

General Tech Bugs & Fixes
Max. 2000 characters

Jadav Payeng


( 7 months ago )

I can easily interact with metamask via web3 js like this (JS):

web3 = new Web3(web3.currentProvider);

Is it possible to interact with metamask via php? For example (PHP):

$ethereum = new Ethereum('', 8545);

Javascript equivalent (JS):

web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

But the PHP one posted above can only connect to a server node via IP address and I'm not sure if its possible / how to connect with a metamask user in PHP.

I dont think its possible because PHP is server side but if anyone has some insight on this I would appreciate it..

Shiv Thapa


( 7 months ago )

No, this is not possible. PHP is executed on the server, JavaScript is executed in the browser. PHP could theoretically connect to a node that you run yourself on your own server, but not to a node on the client or to a browser add-on.

what's your interest