Page 1 of 1

user input php

Posted: Tue Sep 15, 2009 5:31 pm
by 000zero
Hello Im relatively new to php and i was wondering what is the best way to handle user input?

Essentially i want to prompt the user for a server, user, psswd, and port and when they submit the input my php code will attempt to connect and if the connection is a success then go to the next page, if the connection is not a success stay on the first page and print an error message.

I was going to use $_POST and post the input to the same page, but i want to know if there is a better convention i should be following?

thanks for any advice

Re: user input php

Posted: Tue Sep 15, 2009 7:00 pm
by requinix
That's pretty much it, unless you want to get advanced and use AJAX.

But even if you do you should have a non-JavaScript fallback mechanism. Like POSTed data.