hi!

now my problem is how to read the data inputted by a user, i have tried to do some simple form and php file only to verify if i have understand, but i obviously havn't! -.-

here are the form, the php file and the javascript:


Code:
			<form action="login.php" method="post" id="form_homepage_login">
				
				<label for="username" id="label_username">Username: </label>
				<input type="text" name="username" id="input_username" maxlenght="30" size="20" autofocus  />
				
				<label for="password" id="label_password">Password: </label>
				<input type="password" name="password" id="input_password" maxlenght="30" size="20"  />

				<input type="submit" id="submit_login" value="Log In" />
			</form>





<?php

	$username = $_POST['username'];
	$password = $_POST['password'];
	
	if($username=="svidotto" and $password=="123456789")
		{
		print "Logged in!";
		{
	else
		{
		print "Error!";
		}
?>






	$("#submit_login").click(function(){
	  $.post("login.php",
	 {
		var username = $('#input_username').val();
		var password = data.find('#input_password').val();
	  },
	  login_succesfull(data,status,xhr){
		
		if (status == "SUCCESS")
		{
			window.location.href = "/login";
		}
		
		else
		{
			alert(data);
		}
		
	  }, "text");
	});


	

	});

do i have to define the action and the method in the form or not?
where are my mistakes?

THX!