Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Error in PHP when validating W3C

Posted on 2014-09-19
10
789 Views
Last Modified: 2014-09-19
I am running validation on one of my new PHP pages.

This is the line:

<?php require_once( "../../webassist/security_assist/helper_php.php" ); ?>

This is the error:

Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.)
0
Comment
Question by:amucinobluedot
10 Comments
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 333 total points
ID: 40332500
That means that your PHP script is not getting parsed through the PHP parser.  Do you have the correct file suffix?  You can check some of this with a little script like this one, shown here in its entirety.

<?php phpinfo();

Open in new window

0
 

Author Comment

by:amucinobluedot
ID: 40332514
Yes. the file is:  default.php and it displays just fine.

I get those errors when I run the Validation in Dreamweaver

Your script shows a page with all PHP info
0
 
LVL 11

Assisted Solution

by:Radek Baranowski
Radek Baranowski earned 167 total points
ID: 40332524
maybe you need to set expilictly that the file is of php type.

but best try to run this file in a browser within working PHP container (server) to see if the code works.

if it works, then probably this is only Dreamweaver validation issue.
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

Author Comment

by:amucinobluedot
ID: 40332527
The page works just fine, its only when I run DW validation that displays those errors.
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 333 total points
ID: 40332541
Dreamweaver was a good tool for building simple web sites many years ago, but nobody does that any more.  Today we use things like the Laravel framework instead.  And you can feed your finished script directly to the validator -- you do not need (and probably do not want) the interference of Dreamweaver.
http://validator.w3.org/
0
 

Author Comment

by:amucinobluedot
ID: 40332551
Well .. I am using DW because I have been using it for years and I currently have some great extensions (DMXZone) and (Webassist) which help me code fast. So for now I will stick to it and about the errors I will simply ignore the DW hints  :)   Plus I can't validate a page that is inside an intranet I don't think.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 40332562
Don't know about your intranet, but you can probably copy the HTML and paste it into a public-facing document then fire up the validator.  I often do that just to make sure I'm on track and not doing something like accidentally duplicating ID attributes.
0
 

Author Comment

by:amucinobluedot
ID: 40332571
:)
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40333125
I get those errors when I run the Validation in Dreamweaver

Don't do it that way.  DW can't parse PHP at all, so what it does is transfer the entire page markup (minus things like Template or Library code) to W3.  So all PHP code gets treated like HTML.

Always, always make W3 look at RENDERED code.  That means giving it a working web link.  Use Firebug and a browser to make this fast and easy.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 40333134
Firebug and a browser
Google Chrome Dev Tools are pretty good, too.
http://discover-devtools.codeschool.com/
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to dynamically set the form action using jQuery.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question