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

How to validate a URL that receives POST variables?

P: n/a
Kit
Hi there,
I am recoding a website, and I want to add a generic footer to each
page, using an included file with PHP snippets. Part of that footer
would be a link to validate the page using the W3C's validation
service. The code currently looks like this:

<code>

<a href="http://validator.w3.org/check?uri=<?php echo
"http://www.athenatest.org" . $PHP_SELF; ?>" >
Valid XHTML 1.0
</a>

</code>

This code will correctly grab the current URL. But what about pages
that receive POST variables? I am going to try to use POST rather
than GET for most variable-passing, and some pages may even get
different sets of variables depending on who calls them.

I see on the PHP website
(http://us3.php.net/manual/en/reserved.variables.php) that there is an
array of all POST variables called $_POST. Is there a way I can use
it to simulate calling the page with those variables, so that the
validator is validating the same dynamically-created page?

Maybe I should make the validator link secretly a form submission
button?

Any ideas welcome. Surely I'm not the first person on the web to need
this. :-)

Chris McCormick, webmaster
The Athenaeum - Interactive Humanities Online
http://www.the-athenaeum.org

PS - Any solution will be given back to the list, of course.
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 29 Dec 2003 12:49:18 -0800, Kit declared in
comp.infosystems.www.authoring.html:
Hi there,
I am recoding a website, and I want to add a generic footer to each
page, using an included file with PHP snippets. Part of that footer
would be a link to validate the page using the W3C's validation
service.
Why? What makes you think your visitors care? Or even know what it
means? At least you aren't using that ugly image the W3C created.
<a href="http://validator.w3.org/check?uri=<?php echo
"http://www.athenatest.org" . $PHP_SELF; ?>" >
Valid XHTML 1.0
</a>


<Sigh> If you must:

<a href="http://validator.w3.org/check/referer"> </a>

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 20 '05 #2

P: n/a
Kit
Mark Parnell <we*******@clarkecomputers.com.au> wrote in message news:<1l*****************************@40tude.net>. ..
On 29 Dec 2003 12:49:18 -0800, Kit declared in
comp.infosystems.www.authoring.html:
Hi there,
I am recoding a website, and I want to add a generic footer to each
page, using an included file with PHP snippets. Part of that footer
would be a link to validate the page using the W3C's validation
service.
Why? What makes you think your visitors care? Or even know what it
means? At least you aren't using that ugly image the W3C created.


Well, while you seem a bit grumpy about it, I suppose you raise a
valid point. here's my reasoning:

1. I want to write valid code, for all of the obvious reasons. If you
don't know what *those* are, I'll not explain it here. But the main
reason for the inclusion of validation in the footer is for *me*, so I
can easily validate any page where I include the footer.

2. We do some fairly comlex things on the site, and it doesn't always
work for everybody. Plus, there are situations where a portion of the
page may have been filled in by a user, using an input form that
allows HTML input. For those reasons, it's useful to be able to see
if a page validates during troubleshooting.
<a href="http://validator.w3.org/check?uri=<?php echo
"http://www.athenatest.org" . $PHP_SELF; ?>" >
Valid XHTML 1.0
</a>


<Sigh> If you must:


Seriously, can I get you some coffee or something? Anything to cheer
you up.

<a href="http://validator.w3.org/check/referer"> </a>

Jul 20 '05 #3

P: n/a
Kit wrote:

But the main
reason for the inclusion of validation in the footer is for *me*, so I
can easily validate any page where I include the footer.


You don't need a link on the page to do that. mozilla has an extension
with a slew of validators for whatever the current page is ("checky"),
and Opera7 has HTML validation built-in to the document context menu.
There's some new IE toolbar add-on that probably has this feature, too.

Bookmarklets are another option. There are several reference sites out
there now, it shouldn't take you long to find one for your particular
browser of choice.

--
To email a reply, remove (dash)un(dash). Mail sent to the un
address is considered spam and automatically deleted.
Jul 20 '05 #4

P: n/a

"kchayka" <kc*********@sihope.com> wrote in message
news:3f***********************@news.twtelecom.net. ..
You don't need a link on the page to do that. mozilla has an extension
with a slew of validators for whatever the current page is ("checky"),
and Opera7 has HTML validation built-in to the document context menu.
There's some new IE toolbar add-on that probably has this feature, too.


That is on the toolbar - the link is in a post of mine about maybe a week
ago. Get it, seriously, it's made IE a very tolerable browser.

Still, is there harm to the user in including a link in the footer? Think -
say someone comes along and checks out the page. They've done some web
design but have never heard of W3C. Suddenly, this curious link opens a
whole new world for them. Soon another copy of FrontPage is in the recycle
bin and they're using tables for tables, and the world is indeed a better
place.

That's sorta how it worked for me. I think those links are great, so long as
they're not obnoxiously in your face.
Jul 20 '05 #5

P: n/a
On Tue, 30 Dec 2003, Kit wrote:
1. I want to write valid code, for all of the obvious reasons. If you
don't know what *those* are, I'll not explain it here.
No arguments from me. However, I'm dubious of the value of
advertising that on every web page (it might appear on some kind of
"About us" or "Our web design philosophy" etc. page).
But the main
reason for the inclusion of validation in the footer is for *me*, so I
can easily validate any page where I include the footer.
Use a bookmarklet. Works for all pages - needs no botching of the
page source itself.
2. We do some fairly comlex things on the site, and it doesn't always
work for everybody. Plus, there are situations where a portion of the
page may have been filled in by a user, using an input form that
allows HTML input. For those reasons, it's useful to be able to see
if a page validates during troubleshooting.


Suggests you have a bad process. Who's doing this troubleshooting?
If it's you, then use that bookmarklet again. If it's them, then
consider re-designing the fill-in process so that it guarantees to
create valid markup -or- so that it rejects unacceptable submissions.

Keep in mind that if you accept unchecked input, and immediately
redisplay it on a web page, then you are creating an unnecessary
security exposure, whereby those submitting material could (whether
unintentionally or deliberately) cause unacceptable consequences.
Check CA-2000-02 and other security alerts related to cross-site
scripting and similar exposures.
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.