user input php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
000zero
Forum Newbie
Posts: 6
Joined: Tue Sep 15, 2009 5:07 pm

user input php

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: user input php

Post 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.
Post Reply