473,399 Members | 2,278 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,399 software developers and data experts.

getting php to validate xHTML strict

praclarush
php version 5.2.5

well here’s the problem, I have this home work for a class, in it we just had to copy things out of the book as they have it and follow along basically. Then the teacher add extra things onto it, one of them is to make sure everything validates xHTML strict. That’s fine except I can't get this small piece of code to validate, can anyone offer a little help. I’m new to the whole php thing.

[PHP]<p><input type="text" name="number" size="20" value="<?php if (!empty($_GET['number'])) echo $_GET['number'] ?>" /></p>[/PHP]

the validation page works if you get rid of the ">" but then the whole script stops working
Feb 20 '08 #1
2 1466
dlite922
1,584 Expert 1GB
php version 5.2.5

well here’s the problem, I have this home work for a class, in it we just had to copy things out of the book as they have it and follow along basically. Then the teacher add extra things onto it, one of them is to make sure everything validates xHTML strict. That’s fine except I can't get this small piece of code to validate, can anyone offer a little help. I’m new to the whole php thing.

[PHP]<p><input type="text" name="number" size="20" value="<?php if (!empty($_GET['number'])) echo $_GET['number'] ?>" /></p>[/PHP]

the validation page works if you get rid of the ">" but then the whole script stops working
you dont' validate the code from the server (with php code in it) you validate the RESULT of the page.

i.e. do a view source, copy and paste that into your XHTML validator.

XHTML means everything has to be in valid XML style.

XML style is

<tagname attributename="value">content aslkdfalskd</tagnam>

or

<tagname />
Feb 20 '08 #2
you dont' validate the code from the server (with php code in it) you validate the RESULT of the page.

i.e. do a view source, copy and paste that into your XHTML validator.

XHTML means everything has to be in valid XML style.

XML style is

<tagname attributename="value">content aslkdfalskd</tagnam>

or

<tagname />
Thanks for the help, sorry I didn't post earler,
praclarush
Feb 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Nobody | last post by:
Okay, you are all so smart in here. Answer me this: IE6 in standards mode doesn't seem to hide scrollbars on the body element (overflow:hide) Ain't this a quandary. I have it in my head that I...
22
by: Haines Brown | last post by:
I have a document with a set of internal links such as: <a name="Z1"></a>... <a name="Z2"></a>... The W3C validator objects to the first instance of the name attribute: There is no attribute...
1
by: Unknown User | last post by:
I just put an iframe in my page, but now the page doesn't validate. I guess I'm using legacy code: <iframe src="produtos.html" id="show-hide" frameborder="0" scrolling="no"></iframe> If I...
12
by: Adam Lipscombe | last post by:
Folks, I need to get the contents of a form attribute. In Read/Write mode this is field, so I can use getElementById("name").value In ReadOnly this is just plain text, so I can use...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
1
by: Simon Barnett | last post by:
Hi, RE: Converting pages including ASP pages for XHTML My question relates to ASP not ASP.NET - I can't find a newsgroup for ASP and hoped it was still relevant in ASP.NET - sorry if it's not....
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
5
by: Neviton | last post by:
Hi this is the html to generate the behavior: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
5
by: Abhishek | last post by:
Hi this is my another validator in javascript to validate the Phone Number :-) <script language='javascript'> function funcCheckPhoneNumber(ctrtxtMobile,e){ if(window.event){ var strkeyIE =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.