Form: action="" question

F

floortje

Hi, I got a question. Im using a form on the page
index.php?do=blaat
<form name="imaniceform" method="post" action="">

Now when I push the send button I get directed to index.php?do=blaat again
wich is great for me.

The question that i have is if I can rely on this
- in internet explorer 5 and higher
- in most standard browsers (ie mozilla netscape etc, I dont care bout lynx
etc)

Floortje
 
J

Jukka K. Korpela

Hi, I got a question.

Have you got a URL? Telling it would be more useful than saying the
obvious, especially since you've been spending your time in puking on
your From field to prevent us from even guess your site's URL.
Im using a form on the page
index.php?do=blaat

What "page" is that?
<form name="imaniceform" method="post" action="">

Thats valid but incorrect markup. The action attribute takes a URL
value, and an empty string is not a URL.
Now when I push the send button I get directed to
index.php?do=blaat again wich is great for me.

Why don't you just use action="index.php" and include the field
The question that i have is if I can rely on this
- in internet explorer 5 and higher
- in most standard browsers (ie mozilla netscape etc,

You are using incorrect markup, so the odds are against you. Not very
much in practice, but why would you do things the wrong way when
there's a simple way of doing them right? There might be something that
you not telling us, and maybe the URL would have revealed your not-so-
obvious reason for doing things the way you do.
I dont care bout lynx etc)

Saying so is the usual way of telling that you have no idea of what
Lynx is, and not a good picture of the World Wide Web either.
 
A

Augustus

floortje said:
Hi, I got a question. Im using a form on the page
index.php?do=blaat
<form name="imaniceform" method="post" action="">

Now when I push the send button I get directed to index.php?do=blaat again
wich is great for me.

The question that i have is if I can rely on this
- in internet explorer 5 and higher
- in most standard browsers (ie mozilla netscape etc, I dont care bout lynx
etc)

why don't you just use:

<form name="imaniceform" method="post" action="index.php?do=blaat">

Or, if this form appears on different pages you could use PHP to find out
what page this is and insert the value for action="..."
 
L

Leif K-Brooks

floortje said:
Hi, I got a question. Im using a form on the page
index.php?do=blaat
<form name="imaniceform" method="post" action="">

Now when I push the send button I get directed to index.php?do=blaat again
wich is great for me.

The question that i have is if I can rely on this
- in internet explorer 5 and higher
- in most standard browsers (ie mozilla netscape etc, I dont care bout lynx
etc)

No. Since you're using PHP, just put the $_SERVER['REQUEST_URI']
variable as the action instead.
 
J

Joel Shepherd

Augustus said:
why don't you just use:

<form name="imaniceform" method="post" action="index.php?do=blaat">

Server-side (CGI) support for mixing POSTs with GET-style URI
parameters is hit or miss. If the OP is going to POST the form,
he/she/it would be better off using a hidden field for the 'do'
parameter (as Jukka suggested).
 
A

Augustus

Joel Shepherd said:
Server-side (CGI) support for mixing POSTs with GET-style URI
parameters is hit or miss. If the OP is going to POST the form,
he/she/it would be better off using a hidden field for the 'do'
parameter (as Jukka suggested).

You can't mix "method=get" with "get style" parameters in the action

If you had:
<form method="get" action="mypage.php?do=blaat">

then the "do=blaat" would be stripped when the form is submitted (the form
items replacing it in the querystring)

I think you are confusing that problem (mixing GET with GET) with mixing GET
and POST...

If the two didn't work together (mixing GET and POST) that would be a
serious flaw and weakness of the language
 
F

floortje

Hi, I got a question.
Have you got a URL? Telling it would be more useful than saying the
obvious, especially since you've been spending your time in puking on
your From field to prevent us from even guess your site's URL.


What "page" is that?

Hehe just wanted to make the question as short as possible

The site is located at
http://www.haagseassurantieclub.nl/~fidipe/Webmaster/index.php (Not finished
yet, when it's finished im moving it to a new site and ill protext the
directory.)

Youl will see nearly all the forms use action=""> and it works here. It's
not a big deal to update them with (another) hidden wariable, just wanted to
know whether this would work on other browsers cause it works on ie and it's
macromedia's default.
You are using incorrect markup, so the odds are against you. Not very
much in practice, but why would you do things the wrong way when
there's a simple way of doing them right?

I dont, thats why I asked. I know I dont know all too much bout html. Im
more a programmer.
There might be something that
you not telling us, and maybe the URL would have revealed your not-so-
obvious reason for doing things the way you do.

Hmm maybe uncontious :)
Saying so is the usual way of telling that you have no idea of what
Lynx is, and not a good picture of the World Wide Web either.

Not really, Ive work with lynx alot but im 100% sure that none of the
webmasters ever will. They use internet explorer or netscape so I just need
to bother about them.

Floortje
 
N

Nico Schuyt

floortje said:
Youl will see nearly all the forms use action=""> and it works here.

Like Leif K-Brooks already mentioned: $_SERVER['REQUEST_URI']
I dont, thats why I asked. I know I dont know all too much bout html.
Im more a programmer.

Ehhh, then you should read a bit more about PHP and MySQL too :)
And the principles of programming and building a website in HTML/CSS are
about the same (applying valid code, version control, testing, debugging
etc)

How it looks in Lynx gives you a lot of information concerning
accessibility.
Unless it's an intranet application, accessibility is of increasing
importance.
Read the thread in "DrempelsWeg vrijblijvende publiciteitsstunt?" in
nl.internet.www.ontwerp

Cheers, Nico
 
J

Joel Shepherd

Augustus said:
I think you are confusing that problem (mixing GET with GET) with mixing GET
and POST...

I'm not.
If the two didn't work together (mixing GET and POST) that would be a
serious flaw and weakness of the language

Mixing GET and POST doesn't make a lot of sense: they imply two very
different modes of response by the server. One is cacheable, one is not.

Beyond that, not all server-side languages cope gracefully with
parameters being passed both in the URI (GET) and via the content
stream sent by POST. Combine at your own risk (well, that, and that of
your visitors).
 
J

Jukka K. Korpela

Hehe just wanted to make the question as short as possible

When you do that by omitting essential information, you are actually
making it as hard as possible to get help.

In other words, it's a good idea to make a question as short as
possible, but not shorter.
The site is located at
http://www.haagseassurantieclub.nl/~fidipe/Webmaster/index.php - -
Youl will see nearly all the forms use action="">

No I don't. No form on that page. I think I will stop wasting my time
with a person who hasn't taken the advice already given and still does
not give relevant information about her or his problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top