Help - Search - Members - Calendar
Full Version: PHP Help
Pixel2Life Forum > Help Section > Desktop Programming
TheVault
I'm taking a Java Programming class in school and I'm really enjoying it. I do notice that its much similar to php.

Well in java, when you ask user for information to be stored in a variable, the code is much like this:

public class ProgramName
{

public static void main(String[] args)
{

int fname, lname; //Variables. fname is First Name & lname is Last Name

System.out.println("Enter your first name"); //asking user for their first name
fname=Keyboard.readInt(); //getting information for their first name

System.out.println("Enter your last name"); //asking user for their last name
lname=Keyboard.readInt(); //getting informatino for their last name

System.out.println("Your name is" + fname + lname); //outputting their first and last name
}
}

----------------
In school, we have a file called Keyboard.java which we downloaded that allows user to enter as much information they desire and it gets stored within the variables I had specified.

Well I'm kinda looking for this same concept. In php, how would I make it where users type information and that information is stored within Variables or Strings so later on, I can display them or something. I really need to know this. I kinda understand PHP better thanks to this Java programming because they are much releated.
NGPixel
You can't do that at all lol. PHP is server-side so it has no possible interactions with the user actions.

You will need to use Forms instead. The user type in a textbox the infos, then click the Submit button and PHP gets the data entered by the user.

I wouldn't say Java is that similar to PHP. Yes it has mostly the same syntax but definitly not interact with the user the same way.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.