473,394 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to validate a URL that receives POST variables?

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
5 5316
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
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
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: deko | last post by:
I have a basic Feedback form - I want to prevent blank entries. The problem with the below code is that the form still Posts if the 'message' field is blank. The form will not post if the...
2
by: deko | last post by:
I use variables in some links on my page. I need to send these variables so I can change the color of the links in the navbar when the user is on that page. If you click around on the site you...
2
by: IanT | last post by:
Hi I need help with my approach to validating de-serialized XML received via webservice. Hopefully someone can point me to sources detailing best practice for the following. I agreed a...
3
by: Claire | last post by:
I have a large record with many enumerated fields. The record is stored in a file and the fields have to be extracted. I validate the data as it's read, but there's so many tests similar to the...
5
by: Jim Heavey | last post by:
When should you use the Page.Validate() method? I thought you would use this method if you have some Server side validation (CustomControl's) you wanted to use and this would cause them to be...
3
by: Mike Logan | last post by:
How do I validate messages? If my schema has a simpleType with facets like "minExclusive" and "maxLength" will the .Net framework validate the message before running the web service? This is what...
3
by: Lord0 | last post by:
I *think* I need to be able to validate subsets of an XML document using different schema. The functionality I'm trying to implement is this. a) External suppliers produce an XML document...
4
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I...
24
by: Mike Hofer | last post by:
Please forgive the cross-post to multiple forums. I did it intentionally, but I *think* it was appropriate given the nature of my question. I'm working on an open source code library to help...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.