Solved [Java] Get user input and submit it into a website.

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

maxownage01

Jr.Coder
Full Member
Nobleman
Apr 23, 2015
69
493
1
Hey there guys, so basically I need to code a Java program that takes user input such as a name and age and submits it into a website.

Any ideas?
 

Ayyyther

Newbie
Dank Tier Donator
Feb 14, 2016
36
143
1
In case someone googles this problem and runs into it, I'll post a solution.

Get input via Scanner.
C++:
Scanner in = new Scanner(System.in);
String newString = in.nextLine();
When OP says "submit to website" - I imagine he's talking about submitting a post request to a web server. To do that, read this. https://stackoverflow.com/questions/3324717/sending-http-post-request-in-java The answers contain multiple different(working) methods to do it.
 

maxownage01

Jr.Coder
Full Member
Nobleman
Apr 23, 2015
69
493
1
Is this for like homework or something?

You can definitely get input from Console.ReadLine ( think its in io or System, probably io ), as for submitting it into a website you can try looking here:

https://stackoverflow.com/questions/3324717/sending-http-post-request-in-java
https://docs.oracle.com/javase/tutorial/networking/sockets/
I know how to get input.
Heres my current code, from here I need to get this input submitted to a website.
Nevermind, I've already tried Googling the answer and I've received no help.
Thanks mambda.
 
Last edited:

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,294
37,938
269
I know how to get input.
Heres my current code, from here I need to get this input submitted to a website.
Nevermind, I've already tried Googling the answer and I've received no help.
Thanks mambda.
I can't see any code, did you edit it out? If so then good luck with it then
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods