invalid form

R

Red

Here's the error:
This page is not Valid HTML 4.01 Strict!
end tag for "FORM" which is not finished

The error occurs on the first '/' in "https://" of this line:
<FORM NAME=login ACTION=https://thesite.com/login.php METHOD=post>

here is the code:
<fieldset> <legend>User login</legend>
<FORM NAME=login ACTION=https://thesite.com/login.php METHOD=post> <p>
Username
<INPUT type="text" name="username" size="8" MAXLENGTH="20">
Password
<INPUT type="password" name="password" size="8" MAXLENGTH="20">
<INPUT TYPE=checkbox NAME=rememberme VALUE=1><INPUT type="submit"
name="action" value="Go!">
<A href="forgotpasswd.php">Forgot your password?</A>
</p></FORM></fieldset>


It seems to be telling me I can't put an url in the action - is that
correct or is it telling me something else ? How do I fix it ?
 
M

Mark Parnell

Previously in alt.html said:
Here's the error:

Where's the URI?
This page is not Valid HTML 4.01 Strict!
end tag for "FORM" which is not finished

Generally this means something is nested incorrectly. But without being
able to see the page, that's impossible to tell.
 
M

Michael Winter

[snip]
<FORM NAME=login ACTION=https://thesite.com/login.php METHOD=post>

From an SGML point-of-view, the two slashes form a short tag. Quote the
attribute value.
here is the code:
<fieldset> <legend>User login</legend>
<FORM

Out of curiosity, why is your fieldset outside the form? It's legal but
unusual. FIELDSET elements are meant to group the controls within a form,
not forms themselves.

[snip]

Mike
 
R

Red

Michael said:
[snip]
<FORM NAME=login ACTION=https://thesite.com/login.php METHOD=post>


From an SGML point-of-view, the two slashes form a short tag. Quote
the attribute value.

Thanks. That did it.
Out of curiosity, why is your fieldset outside the form? It's legal but
unusual. FIELDSET elements are meant to group the controls within a
form, not forms themselves.

I just learned about the fieldset tag- here is the url I used as an example
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_fieldset
If I put it about a form element it just puts a box around that element.
but If I put it around the form it breaks for the legend at the top,
which I like.


[snip]

Mike
 
M

Mark Parnell

Previously in alt.html said:
I just learned about the fieldset tag- here is the url I used as an example
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_fieldset
If I put it about a form element it just puts a box around that element.
but If I put it around the form it breaks for the legend at the top,
which I like.

As Michael said, it should be used to group form elements - so basically
replace the paragraph in your example with a fieldset. One fieldset
around all the input elements.
 
R

Red

Mark said:
As Michael said, it should be used to group form elements - so basically
replace the paragraph in your example with a fieldset. One fieldset
around all the input elements.
Ok Done. Thanks for the tip
 
R

rf

Red said:
end tag for "FORM" which is not finished

The error occurs on the first '/' in "https://" of this line:
<FORM NAME=login ACTION=https://thesite.com/login.php METHOD=post>

That action URI should be in quotes:
<FORM NAME=login ACTION="https://thesite.com/login.php" METHOD=post>

The validator is parsing along and finds action=https: and then finds a /. A
/ signifies the beginning of a closing tag, but the opening tag has not been
completed yet, with a >.

Odd sort of error but that is your problem :)
 
R

Red

I got my php page to validate by saving it as htm and validating that.
So far so good. But when I validate the php page directly I get further
invalid form complaints.
This is what I have in the code:
<FORM name="search" action="search.php" method="GET">
<fieldset><legend><? print $MSG_103 ?></legend>

This is what comes up in the validator:

<FORM name="search" action="search.php" method="GET"><input
type="hidden" name="PHPSESSID" value="c8ffad2baaf1f9ffd71962205098471d" />
<fieldset><legend>Search </legend>

Line 52, column 140: document type does not allow element "INPUT" here;
missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
"ADDRESS" start-tag

If I understand it correctly, the hidden field between the form and the
fieldset tag is causing this error.

Specifically, where did the hidden tag come from ? I'm stumped on how to
look for the source of this hidden tag so I can figure out how to put it
after the fieldset tag. I don't see what invokes the hidden session
element to appear.

Red
 
O

Oli Filth

Red said:
I got my php page to validate by saving it as htm and validating that.
So far so good. But when I validate the php page directly I get further
invalid form complaints.
This is what I have in the code:
<FORM name="search" action="search.php" method="GET">
<fieldset><legend><? print $MSG_103 ?></legend>

This is what comes up in the validator:

<FORM name="search" action="search.php" method="GET"><input
type="hidden" name="PHPSESSID" value="c8ffad2baaf1f9ffd71962205098471d" />
<fieldset><legend>Search </legend>

Line 52, column 140: document type does not allow element "INPUT" here;
missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
"ADDRESS" start-tag

If I understand it correctly, the hidden field between the form and the
fieldset tag is causing this error.

Specifically, where did the hidden tag come from ? I'm stumped on how to
look for the source of this hidden tag so I can figure out how to put it
after the fieldset tag. I don't see what invokes the hidden session
element to appear.

Red

PHP implements sessions either via cookies or via the URL. In your case, it's
adding the session ID to the GET URLs via an automatically added INPUT=hidden
field to the beginning of every form. However, in HTML 4.01 Strict, this is
invalid HTML, so it's basically a bug in PHP; read
http://bugs.php.net/bug.php?id=13472.

There are various php.ini settings you can change (either directly or with
ini_set() at runtime) to change how PHP deals with sessions, cookies and URL
rewrites; see http://www.php.net/manual/en/ref.session.php.

Oli
 
R

red

I got my php page to validate by saving it as htm and validating that.
So far so good. But when I validate the php page directly I get further
invalid form complaints.
This is what I have in the code:
<FORM name="search" action="search.php" method="GET">
<fieldset><legend><? print $MSG_103 ?></legend>

Thisis what comes up in the validator:

<FORM name="search" action="search.php" method="GET"><input
type="hidden" name="PHPSESSID" value="c8ffad2baaf1f9ffd71962205098471d" />
<fieldset><legend>Search </legend>

Line 52, column 140: document type does not allow element "INPUT" here;
missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
"ADDRESS" start-tag

If I understand it correctly, the hidden field between the form and the
fieldset tag is causing this error. Specifically, where did the hidden
tag come from ? Is this something to do with Sessions that is is placing
it in the page ?

I'm stumped on how to look for the source of this hidden tag so I can
figure out how to put it after the fieldset tag. I don't see what
invokes the hidden session element to appear.

Red
 
P

Philip Ronan

red said:
This is what I have in the code:
<FORM name="search" action="search.php" method="GET">
<fieldset><legend><? print $MSG_103 ?></legend>

Thisis what comes up in the validator:

<FORM name="search" action="search.php" method="GET"><input
type="hidden" name="PHPSESSID" value="c8ffad2baaf1f9ffd71962205098471d" />
<fieldset><legend>Search </legend>

Take a look at http://www.forums.34sp.com/viewtopic.php?t=7578
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top