I want to make a program that takes the input ie Username and Password from user , there is a submit button and if everything is correct then user should be able to access another webpage .
A rough blueprint is-
Username:<input type="text" name="name"size="15"><br>
Password:<input type="password" name="pass"><br>
<input type="submit" value="submit">
Now i don't know how to verify the password and username. My friend said it can be done using php. I want to know how it can be done. i know php so i can understand it. Please give the code. I know how to do the same in C++ but i am new to php so plz help.

Hi Jack_1,

for the very basics, you could start with

if (isset($_POST['submit'])){
	if ($_POST['name'] == "myname" && $_POST['password'] == "mypassword"){
echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "'>";
echo "Name:<input name='name' type='text' />";
echo "Password:<input name='password' type='password' />";
echo "<input type='submit' name='submit' value='Login' />";
echo "</form>"

This has absolutely NO SECURITY measures in place at all, but gives you an idea.

To make it more secure, you would need to compare the given name and password to ones stored in a database (not include it in the code), and quite a bit more.
The username for the above code is "myname", the password is "mypassword" and the correct details would forward the user to member.php.

Hope this helps.