How can I submit a user input in an if statement after already submitting a user input

I just made an account for this. So I've been tasked with setting up a menu that can do certain things with a MYSQL database (northwind).

I'm still fairly new to PHP, however, I have to say I'm disappointed that I can't get past the simplest part of the project.

The project simply asks "Your program should interact using plain text only. To make compiling and grading easier, do not include graphics or any other fancy interface.

Your top menu (and the tasks you are asked to implement) includes the following:

add a customer

add an order

remove an order

ship an order

print pending orders with customer information

restock parts

exit

Now I'm supposed to loop around this menu and pick one option. Once I pick an option, I have to perform an SQL query (which I haven't gotten to yet and isn't really part of the question). Once the query stuff is done, it will loop to the menu again.

I've done this so far. It's a bit dirty, but I'm just trying to get this job done so I could refine later. Here's my code:

The problem I have is that after I pick a choice and type an input, the form submits the customer value, not the choice value. The only way the interface works is if I manually input the choice AND the customer value again. Is there anyway I can get the customer value to be submitted while the POST/GET knows that the choice is the same?

This would have been 100x easier to do in Java but I chose to do it in PHP for phpmyadmin support. PHP doesn't seem to have an equivalent to Java's in.nextLine.

So you have lots of issues, for example trying to use PHP as Java and not using static HTML... but you did say you're new, so I'll just get to the point.

When you choose "1" as an option in your text input (which could easily be changed for a radio button or <select> tag), you are creating 2 separate forms, taking choice completely out of the environment and only sending customer-name to the server. Do this instead: