what does the action part mean in the form?

the mail() function

Moderators: macek, egami, gesf

rhender
New php-forum User
New php-forum User
Posts: 13
Joined: Thu Dec 01, 2011 11:36 am

what does the action part mean in the form?

Postby rhender » Tue Feb 07, 2012 11:31 am

I have this in the action attribute in my form element on my personal site.

<form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">

It works fine, but I'm just wondering what it means in layman's terms.


The reason I ask, is because I am helping a friend with his forms, and the action attribute is empty within the quotations.

So I'm guessing it does nothing, if there is nothing for the action. ??

rupali
New php-forum User
New php-forum User
Posts: 140
Joined: Thu Oct 13, 2011 10:32 pm
Location: Chandigarh, INDIA

Re: what does the action part mean in the form?

Postby rupali » Wed Feb 08, 2012 2:26 am

hi,
it means that the the page itself calls from the server, and without anything in action attribute means the same meaning that the page itself calls and the script returns the output on the same page.

rhender
New php-forum User
New php-forum User
Posts: 13
Joined: Thu Dec 01, 2011 11:36 am

Re: what does the action part mean in the form?

Postby rhender » Wed Feb 08, 2012 2:58 pm

Oh ok... thanks rupali.

So just to be sure I'm understanding you correctly... They mean the same thing? Empty or with the PHP SELF stuff...?

rupali
New php-forum User
New php-forum User
Posts: 140
Joined: Thu Oct 13, 2011 10:32 pm
Location: Chandigarh, INDIA

Re: what does the action part mean in the form?

Postby rupali » Wed Feb 08, 2012 10:51 pm

my pleasure rhender :)

yes, both the meanings are same


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 0 guests

cron