Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
is form action really required?
Old 01-31-2008, 09:40 AM is form action really required?
Average Talker

Posts: 20
Trades: 0
I'm working on a PHP script and I noticed that with the action attribute set to index.php yields the same results as leaving the attrib blank (""), so... why is it required?
koolaid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-31-2008, 10:26 AM Re: is form action really required?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
It is requires by the w3c specification.

Now, if you don't have it, the browser adds it with a default to the current URL, but it's a browser specific value.

You could have a browser who don't set it at all.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-31-2008, 11:14 AM Re: is form action really required?
Average Talker

Posts: 20
Trades: 0
Quote:
Originally Posted by tripy View Post
It is requires by the w3c specification.

Now, if you don't have it, the browser adds it with a default to the current URL, but it's a browser specific value.

You could have a browser who don't set it at all.
Alright, but can I use '/' instead? so action="/" is the main page.
koolaid is offline
Reply With Quote
View Public Profile
 
Old 01-31-2008, 02:18 PM Re: is form action really required?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
What you can get away with is not the same as what you ought to do. What's so big a deal about putting in the form action?
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-31-2008, 04:35 PM Re: is form action really required?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
Alright, but can I use '/' instead? so action="/" is the main page.
Sure you can...
But as asked said Jeremy, why is it such a big deal ?
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-01-2008, 03:51 AM Re: is form action really required?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Usually the script that displays some form processes that form also. In this case I always set form action="". If I display some form on every page of the site, e.g. search form, then it is reasonable to set certain form action, e.g. action="/search/".
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to is form action really required?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46328 seconds with 12 queries