By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,729 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,729 IT Pros & Developers. It's quick & easy.

XHTMl validation and PHP

P: n/a
I don't know where to look for this. I have a form that submits a search
query to a db. This all works fine, data is retrieved and displayed
properly. I create a session to carry part of the data to the next page,
where I update the db based on the results of the search.

When I try to validate my page as strict xhtml, all is well, except that
PHP adds a hidden input element to my form. In xhtml, input elements
must be inside a block-level container (<div>, <p>, <whatever>), but
when PHP adds the input element, it doesn't create the container
(although it does add the correct end tag), and the validator chokes.

Can someone point me somewhere?

[please don't reply by email, that's a black spamhole]
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Sun, 09 Nov 2003 15:51:36 -0500, Warren Oates <Wa****@InHell.Com> wrote:
I don't know where to look for this. I have a form that submits a search
query to a db. This all works fine, data is retrieved and displayed
properly. I create a session to carry part of the data to the next page,
where I update the db based on the results of the search.

When I try to validate my page as strict xhtml, all is well, except that
PHP adds a hidden input element to my form. In xhtml, input elements
must be inside a block-level container (<div>, <p>, <whatever>), but
when PHP adds the input element, it doesn't create the container
(although it does add the correct end tag), and the validator chokes.

Can someone point me somewhere?


How about:

http://www.php.net/session

"
url_rewriter.tags string
url_rewriter.tags specifies which html tags are rewritten to include session id
if transparent sid support is enabled. Defaults to
a=href,area=href,frame=src,input=src,form=fakeentr y,fieldset=

Note: If you want XHTML conformity, remove the form entry and use the
<fieldset> tags around your form fields.
"

I'm assuming this means it will put the hidden input element inside a
<fieldset>?

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #2

P: n/a
In article <jo********************************@4ax.com>,
Andy Hassall <an**@andyh.co.uk> wrote:

:
:http://www.php.net/session
:
:"
:url_rewriter.tags string
:url_rewriter.tags specifies which html tags are rewritten to include session id
:if transparent sid support is enabled. Defaults to
:a=href,area=href,frame=src,input=src,form=fakeent ry,fieldset=
:
:Note: If you want XHTML conformity, remove the form entry and use the
:<fieldset> tags around your form fields.
:"
:
: I'm assuming this means it will put the hidden input element inside a
:<fieldset>?

Thanks, Andy, I'll read through that and see what I can do.
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Jul 17 '05 #3

P: n/a
In article <jo********************************@4ax.com>,
Andy Hassall <an**@andyh.co.uk> wrote:

:"
:url_rewriter.tags string
:url_rewriter.tags specifies which html tags are rewritten to include session id
:if transparent sid support is enabled. Defaults to
:a=href,area=href,frame=src,input=src,form=fakeent ry,fieldset=
:
:Note: If you want XHTML conformity, remove the form entry and use the
:<fieldset> tags around your form fields.
:"
:
: I'm assuming this means it will put the hidden input element inside a
:<fieldset>?

It means that you have to remove the "form" entry from url_rewriter.tags:

ini_set("url_rewriter.tags","a=href,area=href,fram e=src, fieldset= ");

and then enclose your form in a fieldset container:

<form action="bb_search.php" method="post">
<fieldset>
<legend> Enter a name to search for.</legend>
<input type="text" name="chosen" />
<input type="submit" name="fetch" value="search" />
</fieldset>
</form>

and then it all works. The session variable is carried to the next page,
and the validator doesn't choke. Note that the validator's "display
code" option would show the "hidden" input before, now it doesn't. More
reading is in order.

Thanks for your help!
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.