Sunday, January 16, 2011

More on Method and Action (HTML + PHP )

Oke,then for this post,we will test another method which is POST,so change it from GET to POST.Here is the example:

<FORM NAME ="formOne" METHOD ="POST" ACTION = "">

then press login button..



the?Submit1=Login is now gone. This is because we used POST as the method. Using POST means that the form data won't get appended to the address in the address bar for all to see.for more click here!

now,we will learn about ACTION.

<FORM NAME ="formOne" METHOD ="" ACTION = "">

the action is  specifies where to send the form-data when a form is submitted. for more on ACTION.so for this lesson we will send the script to the same page that the form is on – send it to itself, in other words. We'll use that technique first.

what u need to do is just change the previous script click here.Then locate this line:

<Form Name ="formOne" Method ="POST" ACTION = "">

change it to be like this:

<Form Name ="formOne" Method ="POST" ACTION = "bsicForm.php">

 bsicForm.php: so this is my file name,how about yours? 

So,we're going to send the form data to it itself. Then save ur work again in PHP file just to remind and then click the submit button.u wont see anything different but make sure there is no any error message!

 N/NOTE:we have learn two method :GET N POST + ACTION...anything fine?if not,comment me here!

No comments:

Post a Comment