How to send data to a port from a webpage??

silverscorpion

silverscorpion

@silverscorpion-iJKtdQ Oct 26, 2024
Hi guys,
I'm in need of something for a project.

I have a webpage. It has HTML and some php in it. Now, the page has a button. If the button is clicked,
I want to get the value of a particular textbox in the page and send it to a port in the server's computer.How to do that?

To elaborate, the server computer will be running a java program which will be listening on a particular port. Now, if the client
clicks a button, then the textbox value must come to the port which is being listened to in the server. How can I do this? Any ideas?

Edit : Assume port number to be anything other then ports which are used for specific things by default, say 80 or 21.
Assume it to be 8001 or 9000 etc..

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • sookie

    sookie

    @sookie-T06sFW Apr 28, 2010

    Hi silverscorpion,

    I guess if you add a property of the same name as that of your "textbox" name in html.php page and make getter setter of that property then that value should be available in your java program. Still, can't say anything without looking at your both the programs because way of retrieving parameter value changes based on the way they are passed.

    If possible, please post your piece of code. Thanks !
  • hardtarget

    hardtarget

    @hardtarget-oEknko May 11, 2010

    Hi silverscorpion,
    Socket programming in php helps your need, you may find what you need in #-Link-Snipped-#, you can send data to port.